event-emmiter
Version:
Thats package is an event emmiter
58 lines (38 loc) • 817 B
Markdown
# Eventjs
### Document
##### Get start
you must have been installed node and npm for continue
###### first install with
* npm
```bash
npm i event-emmiter
```
* or use yarn
```bash
yarn add event-emmiter
```
###### second step is importing this library
* es5
```js
const Eventjs = require("event-emmiter")
```
* or es6+ and ts
```js
import Eventjs from "event-emmiter"
```
##### now you must create new instance of a class do you has import
```js
const eventer = new Eventjs
```
##### now you can use this object eventer to emmit and recive events
```js
// 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
```