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 6,825
This Week 14,791
This Month 102,488
Last Day 7,966
Last Week 43,112
Last Month 167,787
Dependencies (0)
None
Dev Dependencies (2)
Dependents (399)

Copyright 2014 - 2016 © taobao.org |