New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

ebinder

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ebinder

a little module for batch binding to event emitters

latest
Source
npmnpm
Version
0.2.0
Version published
Maintainers
1
Created
Source

ebinder

Build Status

a little module for batch binding to event emitters. just npm install ebinder.

examples

var EventEmitter = require('events').EventEmitter;
var ebinder = require('ebinder');

var emitter = new EventEmitter();
var obj = {
	test: function(arg) {
		// arg == true
		// .. do something
	}
};

// returns emitter
ebinder(emitter, obj);
emitter.emit('test', true);

api

(emitter, object, [optional]prefix)

Takes an EventEmitter and an Object, and for each property in the object that is of type function, we map it as a listener for an event on emitter by that name. Returns 'EventEmitter'. If [optional]prefix is given, each property will have prefix: in front of the property for the event name (ie: prop will bind to the event prefix:prop).

Keywords

event

FAQs

Package last updated on 25 May 2015

Did you know?

Socket

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.

Install

Related posts