1.1.2 • Published 10 years ago
generatorify v1.1.2
Generatorify
Name is a bit misleading, this package wrap a function with callback into native ES6 promise so it can be used with generators. Module is based on this gist.
Prerequests
This library works with io.js or node.js with --harmony
flag. It requires
native Promises and Generators.
Usage
'use strict'
const request = require('request')
const generatorify = require('generatorify')
const requestGenerator = generatorify(request)
const load = function* () {
let result = yield requestGenerator('http://www.google.com')
...
}
Test
tap test/*.js
Limitations
As mentioned above, this module requires io.js or node.js with --harmony
flag.
Also it works only with functions with one callback, if you have more than one,
only one will be converted.
1.1.2
10 years ago
1.1.1
10 years ago
0.0.0-semantically-released
10 years ago
1.1.0
10 years ago
1.0.0
10 years ago