Convert callback-based JS function into promise. Simple, 10LOC, no deps.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md
index.js
package.json
test.js

README.md

micro-promisify

Convert callback-based function into promise. Simple, 10LOC, no deps.

Usage

const promisify = require('micro-promisify');
const fs = require('fs');

const promise = promisify(fs.readFile)('filename.txt');

Runtime support

Node.js 4+ and modern browsers only.

License

MIT (c) 2016 Paul Miller (http://paulmillr.com)