
Product
Socket for Jira Is Now Available
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.
coroutinify
Advanced tools
Coroutinify is a simple Generator based control flow middlware package for Node.js.
It's like Bluebirds' coroutine and uses it internally. In spite of Bluebird's coroutine, it can be used not only with GeneratorFunctions but also with objects which contain GeneratorFunctions. It supports ES6 classes and Symbol keys too.
In case of object the original functions are not removed but added Gen suffix to its name.
const co = require('coroutinify');
function* generator() {
let index = 0;
while(index < 3)
yield index++;
return index;
}
co(generator)()
.then(value => console.log(value));
const co = require('coroutinify');
const Promise = require('bluebird');
let objcet = {};
object.gen1 = function* () {
let index = 0;
while(index < 3)
yield index++;
return index;
};
objcet.gen2 = function* () {
let index = 0;
while(index < 3)
yield index++;
return index;
};
objcet[Symbol.for('gen3')] = function* () {
let index = 0;
while(index < 3)
yield index++;
return index;
};
co(object);
Promise.all([
object.gen1(),
object.gen2(),
objcet[Symbol.for('gen3')]()])
.then(results => console.log(results));
const co = require('coroutinify');
const Promise = require('bluebird');
class ES6 {
*gen1 () { yield 1; }
*gen2 () { yield 2; }
*[Symbol.for('gen3')] { yield 3; }
}
let es6Instance = new ES6();
co(es6Instance);
Promise.all([
es6Instance.gen1(),
es6Instance.gen2(),
es6Instance[Symbol.for('gen3')]()])
.then(results => console.log(results));
FAQs
generator based control flow middlware
We found that coroutinify demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.