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

emanate

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

emanate

Event emitter for the browser

  • 1.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-33.33%
Maintainers
1
Weekly downloads
 
Created
Source

Table of Contents

Emanate

Stability: stable.

Event emitter for the browser.

Install

npm i emanate --save

EventEmitter

The event emitter class is the base class that provides event dispatching. It is designed to mimic the node event emitter.

Methods

emitter.addListener(event, listener)

Adds a listener to the end of the listeners array for the specified event.

Returns emitter, so calls can be chained.

Aliased via the on method.

emitter.removeListener(event, listener)

Remove a listener from the listener array for the specified event. Caution: changes array indices in the listener array behind the listener.

Returns emitter, so calls can be chained.

Aliased via the off method.

emitter.once(event, listener)

Adds a one time listener for the event. This listener is invoked only the next time the event is fired, after which it is removed.

Returns emitter, so calls can be chained.

emitter.removeAllListeners([event])

Removes all listeners, or those of the specified event.

Returns emitter, so calls can be chained.

emitter.listeners(event)

Returns an array of listeners for the specified event.

emitter.emit(event, [arg1], [arg2], [...])

Execute each of the listeners in order with the supplied arguments.

Returns true if event had listeners, false otherwise.

Developer

Developer workflow is via gulp but should be executed as npm scripts to enable shell execution where necessary.

Test

Run the headless test suite using phantomjs:

npm test

To run the tests in a browser context open test/index.html or use the server npm start.

Start

Serve the test files from a web server with:

npm start

Cover

Run the test suite and generate code coverage:

npm run cover

Lint

Run the source tree through eslint:

npm run lint

Clean

Remove generated files:

npm run clean

Spec

Compile the test specifications:

npm run spec

Instrument

Generate instrumented code from lib in instrument:

npm run instrument

Readme

Generate the project readme file (requires mdp):

npm run readme

License

Everything is MIT. Read the license if you feel inclined.

Generated by mdp(1).

FAQs

Package last updated on 18 Aug 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