thunkify-or-promisify
thunkify or promisify a callback style function
Last updated 12 years ago by coderhaoxin .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install thunkify-or-promisify 
SYNC missed versions from official npm registry.

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

Current Tags

  • 0.4.0                                ...           latest (12 years ago)

4 Versions

  • 0.4.0                                ...           12 years ago
  • 0.3.0                                ...           12 years ago
  • 0.2.0                                ...           12 years ago
  • 0.1.0                                ...           12 years ago
Maintainers (1)
Downloads
Total 4
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (3)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE