0.1.0 • Published 2 years ago

easyemit v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

EasyEmit - A Tri Platform Event Emitter

EasyEmit is an event emitter for Deno, Node.js, and the web.

Installation

You can install EasyEmit for Node.js, Deno, or directly into a web page via a script tag.

Node.js

# npm
npm install easyemit
# yarn
yarn add easyemit

Deno

import EventEmitter from 'https://deno.land/x/easyemit@0.1.0/index.min.js'

Include Via CDN

<script src="https://unpkg.com/easyemit@0.1.0/index.min.js" />

Usage

let emitter = new EventEmitter()

emitter.on('hello', (data) => {
  console.log(`Hello ${data ?? 'world'}`)
})

emitter.emit('hello')
emitter.emit('hello', 'emitter')

License

MIT