{"_id":"kilt","_rev":"305659","name":"kilt","description":"Combines multiple event emitters into a single emitter","dist-tags":{"latest":"2.0.2"},"maintainers":[{"name":"hueniverse","email":"eran@hammer.io"}],"time":{"modified":"2021-06-03T19:30:51.000Z","created":"2014-06-01T07:07:28.621Z","2.0.2":"2016-07-28T18:56:35.079Z","2.0.1":"2016-05-21T06:50:24.327Z","2.0.0":"2015-11-02T05:11:09.778Z","1.1.1":"2014-08-03T07:17:51.881Z","1.1.0":"2014-06-02T04:04:37.098Z","1.0.1":"2014-06-01T07:07:28.621Z"},"users":{"tmurngon":true},"repository":{"type":"git","url":"git://github.com/hapijs/kilt.git"},"versions":{"2.0.2":{"name":"kilt","description":"Combines multiple event emitters into a single emitter","version":"2.0.2","repository":{"type":"git","url":"git://github.com/hapijs/kilt.git"},"main":"lib/index.js","keywords":["emitter","merge","combine"],"engines":{"node":">=4.0.0"},"dependencies":{"hoek":"4.x.x"},"devDependencies":{"code":"3.x.x","lab":"10.x.x"},"scripts":{"test":"lab -a code -t 100 -L","test-cov-html":"lab -r html -o coverage.html -a code -L"},"license":"BSD-3-Clause","gitHead":"16af7857b4f4b30ba33199bae993ff3120dde3d9","bugs":{"url":"https://github.com/hapijs/kilt/issues"},"homepage":"https://github.com/hapijs/kilt#readme","_id":"kilt@2.0.2","_shasum":"04d7183c298a1232efddf7ddca5959a8f6301e20","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.3.0","_npmUser":{"name":"hueniverse","email":"eran@hammer.io"},"dist":{"shasum":"04d7183c298a1232efddf7ddca5959a8f6301e20","size":2841,"noattachment":false,"key":"/kilt/-/kilt-2.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/kilt/download/kilt-2.0.2.tgz"},"maintainers":[{"name":"hueniverse","email":"eran@hammer.io"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/kilt-2.0.2.tgz_1469732194843_0.009429037338122725"},"directories":{},"publish_time":1469732195079,"_cnpm_publish_time":1469732195079,"_hasShrinkwrap":false,"deprecated":"This module is no longer maintained."},"2.0.1":{"name":"kilt","description":"Combines multiple event emitters into a single emitter","version":"2.0.1","repository":{"type":"git","url":"git://github.com/hapijs/kilt.git"},"main":"lib/index.js","keywords":["emitter","merge","combine"],"engines":{"node":">=4.0.0"},"dependencies":{"hoek":"4.x.x"},"devDependencies":{"code":"3.x.x","lab":"10.x.x"},"scripts":{"test":"lab -a code -t 100 -L","test-cov-html":"lab -r html -o coverage.html -a code -L"},"license":"BSD-3-Clause","gitHead":"19fb9e2238de2502005e64676de1e14a5265b72e","bugs":{"url":"https://github.com/hapijs/kilt/issues"},"homepage":"https://github.com/hapijs/kilt#readme","_id":"kilt@2.0.1","_shasum":"6e3df779df1b89f499819da9252e6f15cd017f33","_from":".","_npmVersion":"3.8.6","_nodeVersion":"6.0.0","_npmUser":{"name":"hueniverse","email":"eran@hammer.io"},"dist":{"shasum":"6e3df779df1b89f499819da9252e6f15cd017f33","size":4091,"noattachment":false,"key":"/kilt/-/kilt-2.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/kilt/download/kilt-2.0.1.tgz"},"maintainers":[{"name":"hueniverse","email":"eran@hammer.io"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/kilt-2.0.1.tgz_1463813423240_0.3291585866827518"},"directories":{},"publish_time":1463813424327,"_cnpm_publish_time":1463813424327,"_hasShrinkwrap":false,"deprecated":"This module is no longer maintained."},"2.0.0":{"name":"kilt","description":"Combines multiple event emitters into a single emitter","version":"2.0.0","repository":{"type":"git","url":"git://github.com/hapijs/kilt.git"},"main":"lib/index.js","keywords":["emitter","merge","combine"],"engines":{"node":">=4.0.0"},"dependencies":{"hoek":"3.x.x"},"devDependencies":{"code":"2.x.x","lab":"7.x.x"},"scripts":{"test":"lab -a code -t 100 -L","test-cov-html":"lab -r html -o coverage.html -a code -L"},"license":"BSD-3-Clause","gitHead":"279a4f5d77241cb95448c051f85daa04eb633392","bugs":{"url":"https://github.com/hapijs/kilt/issues"},"homepage":"https://github.com/hapijs/kilt#readme","_id":"kilt@2.0.0","_shasum":"8a06f6624a14847441c102c3b12e9ef06af5ddf2","_from":".","_npmVersion":"3.3.9","_nodeVersion":"4.2.1","_npmUser":{"name":"hueniverse","email":"eran@hammer.io"},"dist":{"shasum":"8a06f6624a14847441c102c3b12e9ef06af5ddf2","size":4077,"noattachment":false,"key":"/kilt/-/kilt-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/kilt/download/kilt-2.0.0.tgz"},"maintainers":[{"name":"hueniverse","email":"eran@hammer.io"}],"directories":{},"publish_time":1446441069778,"_cnpm_publish_time":1446441069778,"_hasShrinkwrap":false,"deprecated":"This module is no longer maintained."},"1.1.1":{"name":"kilt","description":"Combines multiple event emitters into a single emitter","version":"1.1.1","repository":{"type":"git","url":"git://github.com/hapijs/kilt"},"main":"index","keywords":["emitter","merge","combine"],"engines":{"node":">=0.10.30"},"dependencies":{"hoek":"2.x.x"},"devDependencies":{"lab":"3.x.x"},"scripts":{"test":"make test-cov"},"licenses":[{"type":"BSD","url":"http://github.com/hapijs/kilt/raw/master/LICENSE"}],"contributors":[{"name":"Eran Hammer","email":"eran@hammer.io","url":"http://hueniverse.com"}],"gitHead":"6578faa71ca0870c0bd031d1c74fd03602978f8b","bugs":{"url":"https://github.com/hapijs/kilt/issues"},"homepage":"https://github.com/hapijs/kilt","_id":"kilt@1.1.1","_shasum":"77b4a6163ca7fa5b2137a88c17334216ec23d5db","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"hueniverse","email":"eran@hueniverse.com"},"maintainers":[{"name":"hueniverse","email":"eran@hammer.io"}],"dist":{"shasum":"77b4a6163ca7fa5b2137a88c17334216ec23d5db","size":3579,"noattachment":false,"key":"/kilt/-/kilt-1.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/kilt/download/kilt-1.1.1.tgz"},"directories":{},"publish_time":1407050271881,"_cnpm_publish_time":1407050271881,"_hasShrinkwrap":false,"deprecated":"This module is no longer maintained."},"1.1.0":{"name":"kilt","description":"Combines multiple event emitters into a single emitter","version":"1.1.0","repository":{"type":"git","url":"git://github.com/spumko/kilt"},"main":"index","keywords":["emitter","merge","combine"],"engines":{"node":">=0.10.22"},"dependencies":{"hoek":"2.x.x"},"devDependencies":{"lab":"3.x.x"},"scripts":{"test":"make test-cov"},"licenses":[{"type":"BSD","url":"http://github.com/spumko/kilt/raw/master/LICENSE"}],"contributors":[{"name":"Eran Hammer","email":"eran@hammer.io","url":"http://hueniverse.com"}],"bugs":{"url":"https://github.com/spumko/kilt/issues"},"homepage":"https://github.com/spumko/kilt","_id":"kilt@1.1.0","dist":{"shasum":"b3e71061b1b1d568b9ae3d1863afb8767eaf271a","size":3579,"noattachment":false,"key":"/kilt/-/kilt-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/kilt/download/kilt-1.1.0.tgz"},"_from":".","_npmVersion":"1.4.6","_npmUser":{"name":"hueniverse","email":"eran@hueniverse.com"},"maintainers":[{"name":"hueniverse","email":"eran@hammer.io"}],"directories":{},"publish_time":1401681877098,"_cnpm_publish_time":1401681877098,"_hasShrinkwrap":false,"deprecated":"This module is no longer maintained."},"1.0.1":{"name":"kilt","description":"Combines multiple event emitters into a single emitter","version":"1.0.1","repository":{"type":"git","url":"git://github.com/spumko/kilt"},"main":"index","keywords":["emitter","merge","combine"],"engines":{"node":">=0.10.22"},"dependencies":{"hoek":"2.x.x"},"devDependencies":{"lab":"3.x.x"},"scripts":{"test":"make test-cov"},"licenses":[{"type":"BSD","url":"http://github.com/spumko/kilt/raw/master/LICENSE"}],"contributors":[{"name":"Eran Hammer","email":"eran@hammer.io","url":"http://hueniverse.com"}],"bugs":{"url":"https://github.com/spumko/kilt/issues"},"homepage":"https://github.com/spumko/kilt","_id":"kilt@1.0.1","_shasum":"43109d9bdd96fbefa9113873912ae64320e04469","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"hueniverse","email":"eran@hueniverse.com"},"maintainers":[{"name":"hueniverse","email":"eran@hammer.io"}],"dist":{"shasum":"43109d9bdd96fbefa9113873912ae64320e04469","size":3555,"noattachment":false,"key":"/kilt/-/kilt-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/kilt/download/kilt-1.0.1.tgz"},"directories":{},"publish_time":1401606448621,"_cnpm_publish_time":1401606448621,"_hasShrinkwrap":false,"deprecated":"This module is no longer maintained."}},"readme":"#kilt\n\nCombines multiple event emitters into a single emitter.\n\n[![Build Status](https://secure.travis-ci.org/hapijs/kilt.svg)](http://travis-ci.org/hapijs/kilt)\n\nLead Maintainer - [Emily Rose](https://github.com/nexxy)\n\n## Usage\n\nInstallation:\n\n```bash\n$ npm install --save kilt\n```\n\nInstantiate a kilt instance with the event emitters to combine and listen for\nevents on the new kilt instance. Kilt derives from `EventEmitter` and may also\nbe used to emit events.\n\n```js\nvar Events = require('events');\nvar Kilt   = require('kilt');\n\nvar emitter1 = new Events.EventEmitter();\nvar emitter2 = new Events.EventEmitter();\n\nvar kilt = new Kilt([emitter1, emitter2]);\n\n// A single handler for both emitters.\nkilt.on('hello', function (data) {\n    console.log(data);\n});\n\n// Emit events from multiple emitters.\nemitter1.emit('hello', 'Hello from emitter1');\nemitter2.emit('hello', 'Hello from emitter2');\n\n// Emit a event using kilt.\nkilt.emit('hello', 'Hello from Kilt');\n```\n\nOutput:\n\n```bash\nHello from emitter1\nHello from emitter2\nHello from kilt\n```\n\n### Methods\n\n#### `Kilt([emitter(s)])`\n\nKilt constructor which accepts optional emitters to manage.\n\n```js\nvar kilt = new Kilt();\n... = new Kilt(emitter);\n... = new Kilt([emitter]);\n... = new Kilt([emitter1, emitter2]);\n```\n\n##### `addEmitter(emitter)`\n\nAdd an emitter for kilt to manage.\n\n```js\nvar emitter = new Events.Emitter();\nkilt.addEmitter(emitter);\n```\n\n##### `on(type, listener)`\n\nAttach a listener to all emitters with the specified type.\n\n```js\nkilt.on('example', function (data) {\n    console.log(data);\n});\n```\n\n##### `once(type, listener)`\n\nAttach a listener to all emitters with the specified type that will only fire\nonce.\n\n```js\nkilt.once('example', console.log.bind(console, '\"example\" event emitted once with data:'));\n```\n\n##### `removeListener(type, listener)`\n\nRemove the specified listener.\n\n```js\nvar emitter = new Events.Emitter();\nvar listener = function () {\n    return;\n};\n\nkilt.addEmitter(emitter);\n\n// Attach listener.\nkilt.on('example', listener);\n\n// Remove listener.\nkilt.removeListener('example', listener);\n```\n\n##### `removeAllListeners([type])`\n\nRemove all listeners. Optionally, you may specify the type of listeners to\nremove.\n\n```js\n// Attach listeners.\nkilt.on('example', ...);\nkilt.on('example', ...);\nkilt.on('example', ...);\nkilt.on('other', ...);\n\n// Only remove listeners of a specific type.\nkilt.removeAllListeners('example');\n\n// Remove all listeners.\nkilt.removeAllListeners();\n```\n\n##### `emit(type[, data])`\n\nEmit the specified event with the specified, optional data.\n\n```js\nvar emitter = new Events.Emitter();\nvar kilt = new Kilt(emitter);\n\n// Attach listener.\nkilt.on('example', console.log.bind(console, '\"example\" event emitted with data:'));\n\n// Emit event on kilt.\nkilt.emit('example', 'emitted');\n```\n","_attachments":{},"homepage":"https://github.com/hapijs/kilt#readme","bugs":{"url":"https://github.com/hapijs/kilt/issues"},"license":"BSD-3-Clause"}