fs-promise

Filesystem methods as promises, with optional fs-extra and fs-graceful dependencies

fs-promise

Proxies all async fs methods exposing them as Promises/A+ compatible promises (when, Q, etc). Passes all sync methods through as values.

Also exposes to graceful-fs and/or fs-extra methods if they are installed.

Also works with any-promise library (a pollyfill, es6-promise, promise, native-promise-only, bluebird, rsvp, when, q).

var fsp = require('fs-promise');
 
fsp.writeFile(file('hello1'), 'hello world')
  .then(function(){
    return fsp.readFile(file('hello1'), {encoding:'utf8'});
  })
  .then(function(contents){});