Socket
Socket
Sign inDemoInstall

node-event-emitter

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    node-event-emitter

Direct port of node's EventEmitter with no dependencies. Available for CommonJS and browser environments.


Version published
Weekly downloads
2.4K
increased by6%
Maintainers
1
Install size
27.5 kB
Created
Weekly downloads
 

Readme

Source

node-event-emitter

Direct port of node's EventEmitter with no dependencies. Available for CommonJS and browser environments.

This module was taken from node's source and altered to remove the logic regarding domains and all dependencies. This way it is dependency free, lighter weight and still has the exact same API (minus the domain stuff), making it ideal for those wishing to share code on client and server that depend on EventEmitter.

Documentation

Why

I needed an event system for my client side code and since I'm using node on the backend I wanted to make sure I'm not using two modules and two APIs for the same functionality. In addition, the code in question is being shared on both the client and server so I wanted to make use of EventEmitter on the server and browserify it for the client. The problem is, node's EventEmitter has two dependencies, which each have their own dependencies and an abundance of functionality which I do not need. I wanted something that removed the dependencies and any other code that was specific to node's environment while keeping the same interface and functionality.

I looked for other modules out there that aimed to solve this problem but everything I found was less than ideal. The libraries I came across added additional functionality or changed the API in some way. These libraries were also more lines of code. Given that I'm using the same code on client and server, I cannot have the same module implement two different interfaces depending on the environment. Hence this library.

Obtainage

npm install node-event-emitter

Or if you're interested in using it just in browser environments, you can grab either the minified or non minified vesions in the root of this repo.

LICENSE

MIT

Keywords

FAQs

Last updated on 29 Mar 2014

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