easyemit

0.1.0 • Public • Published

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

/easyemit/

    Package Sidebar

    Install

    npm i easyemit

    Weekly Downloads

    0

    Version

    0.1.0

    License

    MIT

    Unpacked Size

    6.6 kB

    Total Files

    4

    Last publish

    Collaborators

    • otterlord