lagden-promisify
v3.0.0
Published
Convert callback to promise
Downloads
7
Maintainers
Readme
lagden-promisify
Convert callback to promise
Install
Compatible with Node.js >= 6
$ npm i -S lagden-promisify
Compatible with Node.js >= 5.0.0
$ npm i -S [email protected]
Compatible with Node.js >= 4
$ npm i -S [email protected]
Usage
const promisify = require('lagden-promisify');
const fs = require('fs');
const readfile = promisify(fs.readFile);
readfile('./sample.txt')
.then(data => console.log);
.catch(err => console.log);
License
MIT © Thiago Lagden