Socket
Socket
Sign inDemoInstall

evntr

Package Overview
Dependencies
0
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    evntr

Zero-dependency eventing and pub-sub library.


Version published
Weekly downloads
7
increased by250%
Maintainers
1
Install size
7.52 kB
Created
Weekly downloads
 

Readme

Source

Evntr

Zero-dependency eventing and pub-sub library for the browser and Node.js.


Installation

Browser

<script src="path/to/evntr.min.js" type="text/javascript"></script>
<script>
  var evntr = Evntr();
</script>

Evntr is also available from unpkg: https://unpkg.com/evntr@1.0.0/evntr.min.js

Node.js

Install from NPM using npm i --save evntr, then

import Evntr from 'evntr';
const evntr = Evntr();

OR

const evntr = require('evntr')();

Usage

Listen for an event

evntr.on('myEvent', (some, data) => {
  console.log(some, data);
})

Emit an event

evntr.emit('myEvent', {
  hello: 'world'
}, {
  world: 'hello'
});

Remove a listener

evntr.off('myEvent', myListener);

License

MIT License © Umang Galaiya

Keywords

FAQs

Last updated on 03 Oct 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc