npm.io
0.13.1 • Published yesterday

@gjsify/events

Licence
MIT
Version
0.13.1
Deps
1
Size
18 kB
Vulns
0
Weekly
3.8K

@gjsify/events

GJS implementation of the Node.js events module. Provides EventEmitter, once, on, and listenerCount.

Part of the gjsify project — Node.js and Web APIs for GJS (GNOME JavaScript).

Installation

gjsify install @gjsify/events

# npm or yarn also work (e.g. adding it to an existing project):
npm install @gjsify/events
yarn add @gjsify/events

Usage

import { EventEmitter } from '@gjsify/events';

const emitter = new EventEmitter();
emitter.on('data', (msg) => console.log(msg));
emitter.emit('data', 'hello');

Inspirations and credits

License

MIT

Keywords