thunkify
Turn callbacks, arrays, generators, generator functions, and promises into a thunk
Last updated 4 years ago by tjholowaychuk .
MIT · Repository · Bugs · Original npm · Tarball
$ cnpm install thunkify 
SYNC missed versions from official npm registry.

thunkify

Turn a regular node function into one which returns a thunk, useful for generator-based flow control such as co.

Installation

$ npm install thunkify

Example

var thunkify = require('thunkify');
var fs = require('fs');

var read = thunkify(fs.readFile);

read('package.json', 'utf8')(function(err, str){
  
});

License

MIT

Maintainers (1)
Downloads
Today 119
This Week 119
This Month 119,754
Last Day 2,785
Last Week 40,371
Last Month 181,455
Dependencies (0)
None
Dev Dependencies (2)
Dependents (392)

Copyright 2014 - 2016 © taobao.org |