typescript.events
v7.9.0
Published
TypeScript Event Management
Downloads
219
Readme
Events
Implementation of Node.Events in Typescript for Client and Server
Example
Typescript
import {Event} from "typescript.events";
class MyEmitter extends Event {}
let myEmitter = new MyEmitter();
myEmitter.on('event', () => {
console.log('event occured')
});
myEmitter.emit('event');
Javascript
When performing in browser testing with NPM copy, paste and run below example.
var Event = require("typescript.events").Event;
class MyEmitter extends Event {};
let myEmitter = new MyEmitter();
myEmitter.on('event', () => {
console.log('event occured')
});
myEmitter.emit('event');
Refer to Node Documentation for additional information
IntelliSense Exeperience
Installation
npm install typescript.events
Development
Prepare environment
git clone https://github.com/FlippieCoetser/Events
cd Events
npm install
npm link
Lint code
npm run lint
Build code
npm run build
Test code
npm test
Coverage report
npm run report
Package code
npm run package