Skip to content

teawithfruit/node-singleton-event

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-singleton-event

Join the chat at https://gitter.im/teawithfruit/node-singleton-event

A global event bus driven by a singlton event emitter class. Use this module to hook something in other objects.

Install

npm install node-singleton-event -save

How to use

Require it in every file where you want to communicate with another file.

Say something:

var singletonevent = require('node-singleton-event');
singletonevent.emit('talk', 'hello world');

Receive something:

var singletonevent = require('node-singleton-event');
singletonevent.on('talk', function(value) {
  console.log(value);
});

About

A global event bus driven by a singlton event emitter class.

Resources

Stars

Watchers

Forks

Packages

No packages published