Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tj/node-thunkify

Turn a regular node function into one which returns a thunk
https://github.com/tj/node-thunkify

Last synced: 1 day ago
JSON representation

Turn a regular node function into one which returns a thunk

Awesome Lists containing this project

README

        

# thunkify

Turn a regular node function into one which returns a thunk,
useful for generator-based flow control such as [co](https://github.com/visionmedia/co).

## Installation

```
$ npm install thunkify
```

## Example

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

var read = thunkify(fs.readFile);

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

});
```

# License

MIT