Socket
Socket
Sign inDemoInstall

fs-promise

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fs-promise - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0

6

index.js
'use strict';
var fs,
Promise = require('promise'),
Prom = require('any-promise'),
slice = Array.prototype.slice,

@@ -34,3 +34,3 @@ noError = /exists/,

var args = slice.call(arguments);
return new Promise(function(resolve, reject){
return new Prom(function(resolve, reject){
args.push(function(err, res){

@@ -48,3 +48,3 @@ if(err) reject(err);

var args = slice.call(arguments);
return new Promise(function(resolve){
return new Prom(function(resolve){
args.push(resolve);

@@ -51,0 +51,0 @@ func.apply(fs, args);

{
"name": "fs-promise",
"version": "0.2.0",
"version": "0.3.0",
"description": "Filesystem methods as promises, with optional fs-extra and fs-graceful dependencies",

@@ -22,8 +22,15 @@ "main": "index.js",

"dependencies": {
"promise": "~5.0.0"
"any-promise": "0.0.1"
},
"devDependencies": {
"fs-extra": "~0.8.1",
"mocha": "~1.18.2"
"mocha": "~2.0.1",
"fs-extra": "~0.12.0",
"promise": "~6.0.1",
"es6-promise": "~2.0.0",
"rsvp": "~3.0.14",
"bluebird": "~2.3.10",
"when": "~3.5.2",
"q": "~1.0.1",
"native-promise-only": "~0.7.6-a"
}
}

@@ -8,2 +8,18 @@ # fs-promise

Also exposes to `graceful-fs` and/or `fs-extra` methods if they are installed.
Also exposes to [graceful-fs][1] and/or [fs-extra][2] methods if they are installed.
Also works with [any-promise][3] library (a pollyfill, es6-promise, promise, native-promise-only, bluebird, rsvp, when, q).
```javascript
var fsp = require('fs-promise');
fsp.writeFile(file('hello1'), 'hello world')
.then(function(){
return fsp.readFile(file('hello1'), {encoding:'utf8'});
})
.then(function(contents){});
```
[1]: https://github.com/isaacs/node-graceful-fs
[2]: https://www.npmjs.org/package/fs-extra
[3]: https://github.com/kevinbeaty/any-promise

@@ -7,3 +7,3 @@ 'use strict';

assert = require('assert'),
Promise = require('promise'),
Prom = require('any-promise'),
testdir = path.join(__dirname, 'tmp');

@@ -47,3 +47,3 @@

write = fsp.createWriteStream(file('hello2')),
promise = new Promise(function(resolve, reject){
promise = new Prom(function(resolve, reject){
read.on('end', resolve);

@@ -50,0 +50,0 @@ write.on('error', reject);

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc