thunkify-or-promisify
v0.4.0
Published
thunkify or promisify a callback style function
Downloads
135
Maintainers
Readme
Deprecated, use thenify or thenify-all
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