Simple cross-platform event emitter
var energy = require'energy'var emitter = energy
new if you prefer. Either way works :)
var energy = require'energy'var emitter =
.off()removes all listeners for all events
.off(event)removes all event listeners
.off(event, listener)removes all occurrences of event listener
.off(event, listener, quota)remove quota occurrences of event listener
emitteras the source.
energy()object as the source
Works in node and in any browser. Tested in node, Chrome, FF, Opera, IE8
To make edits, first fork the repo, clone your fork, and
cd into it. Run tests via the commands below and/or in a browser. Make edits in src and test as needed. Push your changes and then submit a pull request. Builds (in the project root) are created later via
grunt and should not be changed in pull requests. CLI commands require node and the grunt-cli on your system.
$ npm install -g grunt-cli # install grunt-cli if you haven't already$ npm install # install devDependencies from package.json$ grunt jshint:sub # lint sub dirs$ grunt test # run tests
Support this project by tipping the developer =)