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 94
This Week 12,661
This Month 110,836
Last Day 6,321
Last Week 35,271
Last Month 145,637
Dependencies (0)
None
Dev Dependencies (2)
Dependents (388)

Copyright 2014 - 2016 © taobao.org |