1.0.0 • Published 9 years ago

promise-everything v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

promise-everything Build Status

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);
});