Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

long-emitter

0.3.2 • Public • Published

Node.js Long-Emitter

A buffered event emitter designed for use in simple long-polling event streaming from Node.js servers to web site front-ends, and managing delayed responses & timeouts.

NPM version Licensed MIT Nodejs 0.10+ Downloads Build Status Coverage Status Gittip

Installation

NPM: npm install long-emitter

Example

See the example application for a basic use case.

Basic Usage

var longEmitter = require('long-emitter');
var manager = longEmitter();
var emitter = manager.create();
emitter.emit('a');
emitter.emit('b', 2);
emitter.drain(function (events) {
    // events -> [ ['a'], ['b', 2], ['c', 'hello'] ]
});
emitter.emit('c', 'hello');
emitter.release();

Usage

Documentation to be written.

install

npm i long-emitter

Downloadsweekly downloads

8

version

0.3.2

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability