1.0.0 • Published 9 years ago
promise-everything v1.0.0
promise-everything
Use node.js - style callback functions as Promises
Installation
npm install --save promise-everything
Usage
The function fn will be called with the arguments args + a callback that should be invoked with error + value.
call(fn, [...args]) // => Promise(...)
Example
var call = require('promise-everything'),
fs = require('fs');
// node.js - style
fs.readFile('.editorconfig', function(err, data){
// ...
});
// with promises
call(fs.readFile, '.editorconfig').then(function(data){
console.log(data);
});
1.0.0
9 years ago