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

hitman

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hitman

Fulfilling event contracts for (good?)

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

hitman

Build Status

It's all about fulfilling contracts.

Happy path (works just like an EventEmitter):


  var Hitman = require('hitman').Hitman;

  var emitter = new Hitman(['1', '2']);

  emitter.on('1', function() {
    console.log('hello world');
  });

  emitter.emit('1');

Wrapping an external EventEmitter:


  var Hitman       = require('hitman').Hitman,
      EventEmitter = require('events').EventEmitter;

  var ext_emitter = new EventEmitter(),
      emitter = new Hitman(['1', '2'], { emitter: ext_emitter });

  emitter.on('1', function() {
    console.log('hello world');
  });

  emitter.emit('1');

Both of the following examples will throw an error:


  var Hitman = require('hitman').Hitman;

  var emitter = new Hitman(['1', '2']);

  emitter.on('3', function() {
    console.log('hello world');
  });


  var Hitman = require('hitman').Hitman;

  var emitter = new Hitman(['1', '2']);

  emitter.emit('3');

Keywords

FAQs

Package last updated on 25 Jan 2013

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