thunker
v0.0.4
Published
thunker - thunkify API methods
Downloads
3
Readme
##Thunker##
Thunker takes module and returns Thunked API.
####Warning! It is highly experimental library.####
To install run:
npm install thunker
####Reqired node > v0.11.7####
var fs = require('fs')
, thunker = require('thunker');
fs = thunker(fs); // Thunked API of fs
// or tfs = thunker(fs); to save access to fs props
Thunks needed for Co (https://github.com/visionmedia/co) library. If you use co, you simply wrap module by thunker:
var fs = require('fs')
, co = require('co')
, thunker = require('thunker');
fs = thunker(fs);
co(function* () {
var fileData = yield fs.readFile(__filename, {encoding: 'utf8'});
console.log(fileData);
});
###Runing tests:###
- Install dev dependencies
npm i --dev
- Run command
make test
###References###