thunkify-or-promisify

0.4.0 • Public • Published

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

Package Sidebar

Install

npm i thunkify-or-promisify

Weekly Downloads

32

Version

0.4.0

License

MIT

Last publish

Collaborators

  • coderhaoxin