3.0.3 • Published 7 years ago

apr-awaitify v3.0.3

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

awaitify

Transform a callback-based function into a promise-based one.

npm.io npm.io

Parameters

Examples

import { readFile as readFileCb } from 'fs';
import awaitify from 'apr-awaitify';
import path from 'path';

const readFile = awaitify(readFileCb);
const pkgPath = path.join(__dirname, './package.json');

const pkg = await readFile(pkgPath, 'utf-8');

Returns Function