Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eenano

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eenano

A tiny pessimistic event emitter. Optimized for no listeners.

  • 2.1.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
154
increased by10.79%
Maintainers
1
Weekly downloads
 
Created
Source

eenano

NPM

It's an EventEmitter! Like the one provided by core, but it does a whole lot less!! And it should be faster when there is nothing to do.

This EventEmitter is optimized for no listeners on any event. It should be plenty fast if there are listeners, of course...

It doesn't do most of what the core EventEmitter library does. If you need features, just use core.

A list of things this doesn't do:

  • Remove listeners
  • once
  • Special case the error event
  • domains
  • polymorphic event handlers
  • and more! (less?)

A list of what it does the core library doesn't:

  • Optimized for no listeners at all
  • Allows you to specify a this with .on to avoid Function#bind

var EENano = require("eenano")

var ee = EENano()
ee.on("msg", function (foo) {
  console.log(foo)
})
ee.emit("msg", "hi")
// hi

API

var ee = require("eenano")()

Create an event emitter instance.

.on(event, handler[, thisArg])

On event synchronously call handler() if provided, call handler with this set to thisArg

.emit(event, message)

Call all handlers listening for event with handler(metadata)

.events()

List events that have any handlers

.listeners(event)

List handlers for a given event

LICENSE

MIT

Keywords

FAQs

Package last updated on 17 Jan 2015

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc