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

announcement

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

announcement

Asynchronous event emitter and aggregator.

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

announcement NPM version

Asynchronous event emitter and aggregator.

Install

Install with npm

npm i announcement --save

Run tests

npm test

Usage

var Announcement = require('announcement');

API

Announcement

Main entry point of Announcement event emitter/aggregator

var Announcement = require('announcement');
var announcement = new Announcment();

.on

Register a listener for an event.

  • event {String|Function}: Event type to listen for.
  • cb {Function}: Callback invoked when event type is emitted.
  • returns {Function}: Original callback function or handler function to use to remove listener.
announcement.on('foo', function (data) {
  // do something with data
});

var FooEvent = function () {};
announcement.on(FooEvent, function (data) {
  // data will be an instance of FooEvent
  // do something with data
});

.emit

Asynchronously emit an event and additional data.

  • event {String|Object}: Event type to emit.
// emit string event
announcement.emit('foo', { bar: 'baz' });

// emit typed event
var foo = new FooEvent();
foo.bar = 'baz';
announcement.emit(foo);

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue

Author

Brian Woodward

License

Copyright (c) 2015 Brian Woodward
Released under the MIT license


This file was generated by verb on January 27, 2015.

FAQs

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