1.0.4 • Published 5 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-emmitersecond 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 Eventjsnow 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