attach

Add attach functionality to a routable object

Attach

Add attach functionality to a routable object.

$ npm install attach

Attach adds functionality to attach components to each other.

 
// require it 
var attach = require('attach'),
    routable = require('routable'),
    EventEmitter = require('events').EventEmitter,
    parent = new EventEmitter(),
    child = new EventEmitter();
 
// use it on your object 
routable.extend(parent);
attach.extend(parent);
 
routable.extend(child);
 
parent.defineRoute('child', '/child');
parent.attach(child);
 
  • Write tests