@bastienrobert/events
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

Events

Event emitter for all engines

Partially implements the Node.js events module for environments that do not have it, like browsers
Fast & 525B gzipped (because size matters)

Install

npm install @bastienrobert/events

Usage

import EventEmitter from '@bastienrobert/events'

const eventEmitter = new EventEmitter()
eventEmitter.on('foo', bar => {
  console.log(bar)
})
eventEmitter.emit('foo', 'here we go!')

API

See the Documentation. You can check the Node.js EventEmitter docs too, most methods are implemented in this package.

Dependencies (0)

    Dev Dependencies (13)

    Package Sidebar

    Install

    npm i @bastienrobert/events

    Weekly Downloads

    5

    Version

    1.0.4

    License

    MIT

    Unpacked Size

    18.1 kB

    Total Files

    9

    Last publish

    Collaborators

    • bastienrobert