petersirka / node-filestorage

Storage for storing uploaded files in node.js
MIT License
72 stars 12 forks source link

Promises #12

Open grantcarthew opened 9 years ago

grantcarthew commented 9 years ago

Hi Peter,

This package is fabulous. You have done a great job, well done. Are there any plans to move the functions to promise based?

I know personal projects can chew up time. I would love to do this myself but for time.

Again, great work.

oliversalzburg commented 8 years ago

Just FYI, we're using bluebird to promisify node-filestorage like so:

const Promise = require( "bluebird" );

const filestorage   = require( "filestorage" );
fileStorage = filestorage.create( storageLocation );

// The read() method responds with multiple success arguments.
fileStorage = Promise.promisifyAll( fileStorage, {
    filter    : name => name === "read",
    multiArgs : true
} );

fileStorage = Promise.promisifyAll( fileStorage );