npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

event-bulk-attach

1.0.1

@yoshuawuyts

npmHomeRepoSnykSocket
Downloads:100
$ npm install event-bulk-attach
DailyWeeklyMonthlyYearly

event-bulk-attach

NPM version build status Test coverage Downloads js-standard-style

Attach events to a listener in bulk. Creates an event emitter if none is provided.

Installation

$ npm install event-bulk-attach

Usage

const EventEmitter = require('events').EventEmitter
const attach = require('event-bulk-attach')

const events = {
  foo: [barFn, binFn],
  err: [errFn, blaFn],
  oii: beepFn
}

const emitter = attach(new EventEmitter(), events)

emitter.emit('foo')
// barFn & binFn are called

See Also

  • event-aggregate - event multiplexer

License

MIT