New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

evtify

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

evtify

Event emitter for Node and browsers

  • 0.1.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-60%
Maintainers
1
Weekly downloads
 
Created
Source

evtify

Eventify any object, Node and browsers.

npm install evtify

Setup:

var obj = {}, anotherObj = {};
evtify(obj, anotherObj, ...);
...

Or:

function Person() {};
Person.prototype = new evtify();
var obj = new Person();
...

Register handler for one or more events with optional context:

obj.on('evt1 evt2', function(eventName, params...) {
		// 'this' will be 'window'
	})
   	.on('evt3', function(eventName, params...) { 
   		// 'this' will be 'context'
   	}, context);

Trigger one or more events:

obj.trigger('evt1 evt2 evt3', args...);

Remove all handlers:

obj.off(); 

Remove handlers of specific events:

obj.off('evt1 evt2'); 

Remove a specific handler of specific events:

obj.off('evt1 evt2', handler); 

Aliases:

  • on: addEventListener
  • off: removeEventListener
  • trigger: fire

That's it! Check out the specs for more details.

Keywords

FAQs

Package last updated on 09 Mar 2014

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc