Comparing version 1.3.0 to 2.0.0
require('thenify-all')( | ||
require('thenify-all').withCallback( | ||
require('child_process'), | ||
@@ -4,0 +4,0 @@ exports, [ |
require('thenify-all')( | ||
require('thenify-all').withCallback( | ||
require('crypto'), | ||
@@ -4,0 +4,0 @@ exports, [ |
require('thenify-all')( | ||
require('thenify-all').withCallback( | ||
require('dns'), | ||
@@ -4,0 +4,0 @@ exports, [ |
32
fs.js
var fs; | ||
var Promise = require('native-or-bluebird') | ||
var fs | ||
try { | ||
fs = require('graceful-fs'); | ||
fs = require('graceful-fs') | ||
} catch(err) { | ||
fs = require('fs'); | ||
fs = require('fs') | ||
} | ||
@@ -40,14 +41,19 @@ | ||
var access = fs.access | ||
typeof access === 'function' && api.push('access') | ||
typeof fs.access === 'function' && api.push('access') | ||
require('thenify-all')(fs, exports, api) | ||
require('thenify-all').withCallback(fs, exports, api) | ||
var promisify = require('thenify') | ||
// don't know enough about promises to do this haha | ||
exports.exists = promisify(function exists(filename, done) { | ||
fs.stat(filename, function (err) { | ||
done(null, !err) | ||
exports.exists = function (filename, callback) { | ||
// callback | ||
if (typeof callback === 'function') { | ||
return fs.stat(filename, function (err) { | ||
callback(null, !err); | ||
}) | ||
} | ||
// or promise | ||
return new Promise(function (resolve) { | ||
fs.stat(filename, function (err) { | ||
resolve(!err) | ||
}) | ||
}) | ||
}) | ||
} |
2.0.0 / 2015-05-24 | ||
================== | ||
* support callbacks as well | ||
1.2.0 / 2014-12-16 | ||
@@ -3,0 +8,0 @@ ================== |
{ | ||
"name": "mz", | ||
"description": "modernize node.js to current ECMAScript standards", | ||
"version": "1.3.0", | ||
"version": "2.0.0", | ||
"author": { | ||
@@ -15,3 +15,2 @@ "name": "Jonathan Ong", | ||
"native-or-bluebird": "1", | ||
"thenify": "3", | ||
"thenify-all": "1" | ||
@@ -18,0 +17,0 @@ }, |
@@ -10,3 +10,2 @@ | ||
[![Downloads][downloads-image]][downloads-url] | ||
[![Gittip][gittip-image]][gittip-url] | ||
@@ -114,3 +113,1 @@ Modernize node.js to current ECMAScript specifications! | ||
[downloads-url]: https://npmjs.org/package/mz | ||
[gittip-image]: https://img.shields.io/gittip/jonathanong.svg?style=flat-square | ||
[gittip-url]: https://www.gittip.com/jonathanong/ |
require('thenify-all')( | ||
require('thenify-all').withCallback( | ||
require('zlib'), | ||
@@ -4,0 +4,0 @@ exports, [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7201
2
95
112
- Removedthenify@3