{
  "name": "ultron",
  "version": "1.0.1",
  "description": "Ultron is high-intelligence robot. It gathers intel so it can start improving upon his rudimentary design",
  "main": "index.js",
  "scripts": {
    "test": "mocha --reporter spec --ui bdd test.js",
    "watch": "mocha --watch --reporter spec --ui bdd test.js",
    "coverage": "istanbul cover ./node_modules/.bin/_mocha -- --reporter spec --ui bdd test.js",
    "test-travis": "istanbul cover node_modules/.bin/_mocha --report lcovonly -- --reporter spec --ui bdd test.js"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/unshiftio/ultron"
  },
  "keywords": [
    "Ultron",
    "robot",
    "gather",
    "intelligence",
    "event",
    "events",
    "eventemitter",
    "emitter",
    "cleanup"
  ],
  "author": {
    "name": "Arnout Kazemier"
  },
  "license": "MIT",
  "devDependencies": {
    "assume": "0.0.x",
    "eventemitter3": "0.1.x",
    "istanbul": "0.3.x",
    "mocha": "2.0.x",
    "pre-commit": "0.0.x"
  },
  "bugs": {
    "url": "https://github.com/unshiftio/ultron/issues"
  },
  "homepage": "https://github.com/unshiftio/ultron",
  "readme": "# Ultron\n\n[![Made by unshift](https://img.shields.io/badge/made%20by-unshift-00ffcc.svg?style=flat-square)](http://unshift.io)[![Version npm](http://img.shields.io/npm/v/ultron.svg?style=flat-square)](http://browsenpm.org/package/ultron)[![Build Status](http://img.shields.io/travis/unshiftio/ultron/master.svg?style=flat-square)](https://travis-ci.org/unshiftio/ultron)[![Dependencies](https://img.shields.io/david/unshiftio/ultron.svg?style=flat-square)](https://david-dm.org/unshiftio/ultron)[![Coverage Status](http://img.shields.io/coveralls/unshiftio/ultron/master.svg?style=flat-square)](https://coveralls.io/r/unshiftio/ultron?branch=master)[![IRC channel](http://img.shields.io/badge/IRC-irc.freenode.net%23unshift-00a8ff.svg?style=flat-square)](http://webchat.freenode.net/?channels=unshift)\n\nUltron is a high-intelligence robot. It gathers intelligence so it can start\nimproving upon his rudimentary design. It will learn your event emitting\npatterns and find ways to exterminate them. Allowing you to remove only the\nevent emitters that **you** assigned and not the ones that your users or\ndevelopers assigned. This can prevent race conditions, memory leaks and even file\ndescriptor leaks from ever happening as you won't remove clean up processes.\n\n## Installation\n\nThe module is designed to be used in browsers using browserify and in Node.js.\nYou can install the module through the public npm registry by running the\nfollowing command in CLI:\n\n```\nnpm install --save ultron\n```\n\n## Usage\n\nIn all examples we assume that you've required the library as following:\n\n```js\n'use strict';\n\nvar Ultron = require('ultron');\n```\n\nNow that we've required the library we can construct our first `Ultron` instance.\nThe constructor requires one argument which should be the `EventEmitter`\ninstance that we need to operate upon. This can be the `EventEmitter` module\nthat ships with Node.js or `EventEmitter3` or anything else as long as it\nfollow the same API and internal structure as these 2. So with that in mind we\ncan create the instance:\n\n```js\n//\n// For the sake of this example we're going to construct an empty EventEmitter\n//\nvar EventEmitter = require('events').EventEmitter; // or require('eventmitter3');\nvar events = new EventEmitter();\n\nvar ultron = new Ultron(events);\n```\n\nYou can now use the following API's from the Ultron instance:\n\n### Ultron.on\n\nRegister a new event listener for the given event. It follows the exact same API\nas `EventEmitter.on` but it will return itself instead of returning the\nEventEmitter instance. If you are using EventEmitter3 it also supports the\ncontext param:\n\n```js\nultron.on('event-name', handler, { custom: 'function context' });\n```\n\n### Ultron.once\n\nExactly the same as the [Ultron.on](#ultronon) but it only allows the execution\nonce.\n\n### Ultron.remove\n\nThis is where all the magic happens and the safe removal starts. This function\naccepts different argument styles:\n\n- No arguments, assume that all events need to be removed so it will work as\n  `removeAllListeners()` API.\n- 1 argument, when it's a string it will be split on ` ` and `,` to create a\n  list of events that need to be cleared.\n- Multiple arguments, we assume that they are all names of events that need to\n  be cleared.\n\n```js\nultron.remove('foo, bar baz');        // Removes foo, bar and baz.\nultron.remove('foo', 'bar', 'baz');   // Removes foo, bar and baz.\nultron.remove();                      // Removes everything.\n```\n\nIf you just want to remove a single event listener using a function reference\nyou can still use the EventEmitter's `removeListener(event, fn)` API:\n\n```js\nfunction foo() {}\n\nulton.on('foo', foo);\nevents.removeListener('foo', foo);\n```\n\n## License\n\nMIT\n",
  "readmeFilename": "README.md",
  "_id": "ultron@1.0.1",
  "dist": {
    "shasum": "ed553a9be89f5176bdd5d40b3738345510b84ec6"
  },
  "_from": "ultron@1.0.x",
  "_resolved": "https://registry.npmjs.org/ultron/-/ultron-1.0.1.tgz"
}
