1.1.1 • Published 9 years ago
just-promiseify v1.1.1
just-promiseify
It's a very simple library to convert callback-based flow into Promise style
just-promiseify
can be used in bothnode
andbrowser
env.
Installation
npm install just-promiseify --save
Usage
var promiseify = require('just-promiseify');
var fs = require('fs');
var readFile = promiseify(fs.readFile);
readFile(txt, 'utf8')
.then(function(data) {
console.log('The file content is',data);
})
.catch(function(err){
console.error('Error', err);
});