@uptimeventures/beam

1.0.0 • Public • Published

Beam 📡

CI Status Badge License Made by Uptime Ventures badge

A micro event emitter, smaller than 500k when gzip'd.

Installation

npm install @uptimeventures/beam

Usage

Beam provides essentially the same interface as it's larger Node.js cousin:

import Beam from 'beam'

const emitter = new Beam()

beam.once('message', () => {
  console.log('only tell me about this once')
})

beam.on('alert', (msg) => {
  alert(msg)
})

beam.on('message', ({ name, email }) => {
  console.log(`Hey, ${name}. You have a new message from ${email}.`)
})

beam.emit('alert', 'Something went wrong')
beam.emit('message', { name: 'Nicholas', email: 'n@example.com' })

License

© 2017 Uptime Ventures, Ltd. All rights reserved. Released under the 3-Clause BSD License.

Package Sidebar

Install

npm i @uptimeventures/beam

Weekly Downloads

0

Version

1.0.0

License

SEE LICENSE IN LICENSE

Last publish

Collaborators

  • secretfader
  • renovate