apr-asyncify

3.0.3 • Public • Published

asyncify

Take a sync function and make it async. This is useful for plugging sync functions into a waterfall, series, or other async functions.

Parameters

Examples

import awaitify from 'apr-awaitify';
import asyncify from 'apr-asyncify';
import waterfall from 'apr-waterfall';
import apply from 'apr-apply';
 
const readFile = awaitify(require('fs').readFile);
const pkgPath = path.join(__dirname, './package.json');
 
const pkg = await waterfall([
  apply(readFile, pkgPath, 'utf8'),
  asyncify(JSON.parse)
]);

Returns Function

Package Sidebar

Install

npm i apr-asyncify

Weekly Downloads

4

Version

3.0.3

License

MIT

Last publish

Collaborators

  • ramitos