thunkify-or-promisify

thunkify or promisify a callback style function

MIT 4 个版本
安装
npm install thunkify-or-promisify
yarn add thunkify-or-promisify
pnpm add thunkify-or-promisify
bun add thunkify-or-promisify
README

Deprecated, use thenify or thenify-all

NPM version Build status Test coverage License Dependency status

thunkify-or-promisify

thunkify or promisify a callback style function

var wrapper = require('thunkify-or-promisify');

/**
 * @param origin  {function | object}
 * @param type    {string}           - optional ('thunk': thunkify, any other values: promisify)
 * @param ignores {array}            - optional (ignore some functional properties of object)
 *
 * wrapper(origin, type, ignores)
 */

// promisify
fn = wrapper(fn);
wrapper(object);

// thunkify
fn = wrapper(fn, 'thunk');
wrapper(object, 'thunk');

License

MIT

版本列表
0.4.0 2015-01-19
0.3.0 2014-10-18
0.2.0 2014-10-18
0.1.0 2014-10-12