just-promiseify
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i just-promiseify

Weekly Downloads

2

Version

1.1.1

License

MIT

Last publish

Collaborators

  • howard.zuo