110 lines
6.4 KiB
JSON
110 lines
6.4 KiB
JSON
{
|
|
"_args": [
|
|
[
|
|
{
|
|
"raw": "ultron@1.0.x",
|
|
"scope": null,
|
|
"escapedName": "ultron",
|
|
"name": "ultron",
|
|
"rawSpec": "1.0.x",
|
|
"spec": ">=1.0.0 <1.1.0",
|
|
"type": "range"
|
|
},
|
|
"/home/jdaugherty/work/GT2/GT2-Android/node_modules/ws"
|
|
]
|
|
],
|
|
"_from": "ultron@>=1.0.0 <1.1.0",
|
|
"_id": "ultron@1.0.2",
|
|
"_inCache": true,
|
|
"_location": "/ultron",
|
|
"_nodeVersion": "0.12.3",
|
|
"_npmUser": {
|
|
"name": "3rdeden",
|
|
"email": "npm@3rd-Eden.com"
|
|
},
|
|
"_npmVersion": "2.9.1",
|
|
"_phantomChildren": {},
|
|
"_requested": {
|
|
"raw": "ultron@1.0.x",
|
|
"scope": null,
|
|
"escapedName": "ultron",
|
|
"name": "ultron",
|
|
"rawSpec": "1.0.x",
|
|
"spec": ">=1.0.0 <1.1.0",
|
|
"type": "range"
|
|
},
|
|
"_requiredBy": [
|
|
"/ws"
|
|
],
|
|
"_resolved": "https://registry.npmjs.org/ultron/-/ultron-1.0.2.tgz",
|
|
"_shasum": "ace116ab557cd197386a4e88f4685378c8b2e4fa",
|
|
"_shrinkwrap": null,
|
|
"_spec": "ultron@1.0.x",
|
|
"_where": "/home/jdaugherty/work/GT2/GT2-Android/node_modules/ws",
|
|
"author": {
|
|
"name": "Arnout Kazemier"
|
|
},
|
|
"bugs": {
|
|
"url": "https://github.com/unshiftio/ultron/issues"
|
|
},
|
|
"dependencies": {},
|
|
"description": "Ultron is high-intelligence robot. It gathers intel so it can start improving upon his rudimentary design",
|
|
"devDependencies": {
|
|
"assume": "1.2.x",
|
|
"eventemitter3": "1.1.x",
|
|
"istanbul": "0.3.x",
|
|
"mocha": "2.2.x",
|
|
"pre-commit": "1.0.x"
|
|
},
|
|
"directories": {},
|
|
"dist": {
|
|
"shasum": "ace116ab557cd197386a4e88f4685378c8b2e4fa",
|
|
"tarball": "https://registry.npmjs.org/ultron/-/ultron-1.0.2.tgz"
|
|
},
|
|
"gitHead": "a10482ae98a09120821545456c90c6d60d540f7c",
|
|
"homepage": "https://github.com/unshiftio/ultron",
|
|
"keywords": [
|
|
"Ultron",
|
|
"robot",
|
|
"gather",
|
|
"intelligence",
|
|
"event",
|
|
"events",
|
|
"eventemitter",
|
|
"emitter",
|
|
"cleanup"
|
|
],
|
|
"license": "MIT",
|
|
"main": "index.js",
|
|
"maintainers": [
|
|
{
|
|
"name": "unshift",
|
|
"email": "npm@unshift.io"
|
|
},
|
|
{
|
|
"name": "v1",
|
|
"email": "info@3rd-Eden.com"
|
|
},
|
|
{
|
|
"name": "3rdeden",
|
|
"email": "npm@3rd-Eden.com"
|
|
}
|
|
],
|
|
"name": "ultron",
|
|
"optionalDependencies": {},
|
|
"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",
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "git+https://github.com/unshiftio/ultron.git"
|
|
},
|
|
"scripts": {
|
|
"100%": "istanbul check-coverage --statements 100 --functions 100 --lines 100 --branches 100",
|
|
"coverage": "istanbul cover ./node_modules/.bin/_mocha -- test.js",
|
|
"test": "mocha test.js",
|
|
"test-travis": "istanbul cover node_modules/.bin/_mocha --report lcovonly -- test.js",
|
|
"watch": "mocha --watch test.js"
|
|
},
|
|
"version": "1.0.2"
|
|
}
|