node package manager



minimalistic emitter-system in Javascript, learn maximal 4 method, that you might already know from or Emitter.js. The design decision, to allow only a single parameter to trigger, will help you to write more reusable code.

This code, is not begging to get used from you in production, but maybe it will help you to understand how event-systems work.

var b = {};
b.on('update',function(){console.log('b has updated');});
// output: b has updated 


The tMitter-Method is like an extend of Backbone. it takes an Object and that will get the properties to handle the events.

After an object became an tMitter using "tMitter(theObject)", you can start to listen using "on" or begin to "trigger" events.

the fourth method, that might be interesting is "off". This can be used to remove an event-listener.