Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including ooo with all npm packages installed. Try it out:

var ooo = require("ooo")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

ooo v0.0.7

Another async pattern for node, based on EventEmmitter

ooo

Another async pattern for node, based on EventEmmitter

Installation

$ npm install ooo

How to

Basics

// Bind an event
ooo('echo', console.log);

// Bind an event, juste once
ooo('echo!', function (msg) {
    console.log(msg);    
});


// Fire an event
ooo('echo')('Hello World !');

Bridges

var ooo = require('ooo');
var fs = require('fs');

ooo('file:read', function (err, data) {
    console.log(data.toString());
});

fs.readFile('index.js', ooo('file:read'));

Insert parameters

var ooo = require('ooo');
var fs = require('fs');

ooo('file:read', function (msg1, err, data, msg2) {
    console.log(msg1, data.toString(), msg2);
});

fs.readFile('index.js', ooo('file:read').before('Here is the file').after('Good bye !'));

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free