fs-promise
Advanced tools
Comparing version 0.3.1 to 0.4.0
{ | ||
"name": "fs-promise", | ||
"version": "0.3.1", | ||
"version": "0.4.0", | ||
"description": "Filesystem methods as promises, with optional fs-extra and fs-graceful dependencies", | ||
@@ -22,15 +22,15 @@ "main": "index.js", | ||
"dependencies": { | ||
"any-promise": "~0.1.0" | ||
"any-promise": "~0.2.0" | ||
}, | ||
"devDependencies": { | ||
"mocha": "~2.1.0", | ||
"fs-extra": "~0.13.0", | ||
"promise": "~6.0.1", | ||
"es6-promise": "~2.0.1", | ||
"rsvp": "~3.0.16", | ||
"bluebird": "~2.5.3", | ||
"when": "~3.6.4", | ||
"q": "~1.1.2", | ||
"native-promise-only": "~0.7.6-a" | ||
"mocha": "~2.4.2", | ||
"fs-extra": "~0.26.5", | ||
"promise": "~7.1.1", | ||
"es6-promise": "~3.0.2", | ||
"rsvp": "~3.1.0", | ||
"bluebird": "~3.1.5", | ||
"when": "~3.7.7", | ||
"q": "~1.4.1", | ||
"native-promise-only": "~0.8.1" | ||
} | ||
} |
@@ -5,3 +5,4 @@ # fs-promise | ||
Proxies all async `fs` methods exposing them as Promises/A+ compatible promises (when, Q, etc). | ||
Proxies all async `fs` methods exposing them as ES 2015 (ES6) compatible promises. | ||
Passes all sync methods through as values. | ||
@@ -11,3 +12,3 @@ | ||
Also works with [any-promise][3] library (a pollyfill, es6-promise, promise, native-promise-only, bluebird, rsvp, when, q). | ||
Uses [any-promise][3] to load preferred `Promise` implementation. | ||
@@ -24,4 +25,23 @@ ```javascript | ||
## Usage | ||
Attempts to load libraries in the following order. The first successful require will be proxied to a Promise based implementation. | ||
- [`fs-extra`](https://github.com/jprichardson/node-fs-extra) | ||
- [`graceful-fs`](https://github.com/isaacs/node-graceful-fs) | ||
- `fs` from standard library | ||
Detects a `Promise` implementation using [`any-promise`][3]. If you have a preferred implementation, or are working in an environment without a global implementation, you must explicitly register a `Promise` implementation and it will be used. See [`any-promise`][3] for details. | ||
Typical installation: | ||
```bash | ||
$ npm install --save fs-extra | ||
$ npm install --save fs-promise | ||
``` | ||
Note that `fs-extra` depends on `graceful-fs`, so you would get the benefits of both libraries. | ||
[1]: https://github.com/isaacs/node-graceful-fs | ||
[2]: https://www.npmjs.org/package/fs-extra | ||
[3]: https://github.com/kevinbeaty/any-promise |
7046
45
+ Addedany-promise@0.2.0(transitive)
- Removedany-promise@0.1.0(transitive)
Updatedany-promise@~0.2.0