Attach an EventEmitter listener that emits before all other existing listeners
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
LICENSE.md
README.md
index.js
package.json
test.js

README.md

on-first experimental

Attach an EventEmitter listener that emits before all other existing listeners for that event.

Note: it's also worth checking out timoxley's overshadow-listeners. The API offers more flexibility, and unlike on-first only uses the public EventEmitter API.

Usage

on-first

require('on-first')(emitter, event, listener)

  • emitter is the EventEmitter to listen to.
  • event is the event to listen to.
  • listener is the event callback.

License

MIT. See LICENSE.md for details.