1.1.1 • Published 8 years ago

just-promiseify v1.1.1

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

just-promiseify

NPM version

It's a very simple library to convert callback-based flow into Promise style

just-promiseify can be used in both node and browser 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);
    });

LICENSE

MIT License