aisle
Module for global event handling and namespacing.
$ npm install aisle
Usage
Programmatically
var aisle = ;
Call your aisle
for namespaces or use it as you would an EventEmitter object.
Namespaces
If you call aisle
without any arguments, then aisle
will tap into and return require.main.exports
, otherwise aisle
will return your namespace and its data. If you provide data with your namespace, then aisle
will assign that data to your namespace (namespaces will be created or overwritten.)
// main.jsvar aisle = ; moduleexports = "data": "main"; ; ;
// other.jsvar aisle = ; console; // { data: 'main' }console; // { abc: 123 }console; // undefined
Events
With your Node's version, use Node's documentation to find its EventEmitter abilities.
// main.jsvar aisle = ; aisle; // { data: [ 'here', true ] } ;
// other.jsvar aisle = ; aisle;