1.0.4 • Published 3 years ago
event-emmiter v1.0.4
Eventjs
Document
Get start
you must have been installed node and npm for continue
first install with
- npm
npm i event-emmiter
- or use yarn
yarn add event-emmiter
second step is importing this library
- es5
const Eventjs = require("event-emmiter")
- or es6+ and ts
import Eventjs from "event-emmiter"
now you must create new instance of a class do you has import
const eventer = new Eventjs
now you can use this object eventer to emmit and recive events
// the method on create an listner
eventer.on('event',(message)=>{
console.log(message)
})
/*the method emmit send an message and
dispare the callback function passed an
method on*/
eventer.emmit('event',"Welcomme")
//you can test its