{"_id":"kilt","_rev":"33-0e5f3adb6507c00fefb22fbca8054595","name":"kilt","time":{"modified":"2023-12-01T08:26:34.139Z","created":"2014-06-01T06:56:36.401Z","1.0.0":"2014-06-01T06:56:36.401Z","1.0.1":"2014-06-01T07:07:28.621Z","1.1.0":"2014-06-02T04:04:37.098Z","1.1.1":"2014-08-03T07:17:51.881Z","2.0.0":"2015-11-02T05:11:09.778Z","2.0.1":"2016-05-21T06:50:24.327Z","2.0.2":"2016-07-28T18:56:35.079Z"},"maintainers":[{"email":"jonas.pauthier@gmail.com","name":"nargonath"},{"email":"devinivy@gmail.com","name":"devinivy"},{"email":"nicolas@morel.io","name":"marsup"},{"email":"quitlahok@gmail.com","name":"nlf"}],"dist-tags":{"latest":"2.0.2"},"description":"Combines multiple event emitters into a single emitter","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","versions":{"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@hueniverse.com"}],"dist":{"shasum":"43109d9bdd96fbefa9113873912ae64320e04469","tarball":"https://registry.npmjs.org/kilt/-/kilt-1.0.1.tgz","integrity":"sha512-dFoZeOtRu3qVb6+7FOdi8MtTvvIxIvxMPx0ko0/v3VXKN3/CV4B4d5XssyRE8+7OMb9X6Nl8bprps2ziLWEqqA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCGSVCGrRMl3mQMjDxYEvH1W+wLkFlLWFRP9o974Fow3QIhAMj6WU/lgKgBkhaJihPobq1rbP1rouLIj8NAP67ODBCE"}]},"directories":{},"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","tarball":"https://registry.npmjs.org/kilt/-/kilt-1.1.0.tgz","integrity":"sha512-pzYINeqt7eyueO+DLS6m6uyqX/3RYUSZyoSfnqyB4s2NLSU6CplKOF5uI9vconoDVcYRrajSR68Vg7txFv/SZg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDfIQ9O6qLKKN3RvPT7poXfIZJQQ18b6/nGRMilhWyBbAiEA8d6EX19l6dhXOZ74jCP190OFglvOqGvLuJZNxajwQAk="}]},"_from":".","_npmVersion":"1.4.6","_npmUser":{"name":"hueniverse","email":"eran@hueniverse.com"},"maintainers":[{"name":"hueniverse","email":"eran@hueniverse.com"}],"directories":{},"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@hueniverse.com"}],"dist":{"shasum":"77b4a6163ca7fa5b2137a88c17334216ec23d5db","tarball":"https://registry.npmjs.org/kilt/-/kilt-1.1.1.tgz","integrity":"sha512-j6qVf+w10bxAvgCDyLx6tfza3lpPmjFMkg0HcVvWIvCL4CQ1VMeN6VNWhKDBGTeqc1iBz3pHPbgVfGeQNYQuoQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH3smwveXSi5N8F/S+x7X/L3JQDoQIq+hJwYjZ90TEh4AiEA6sk4UkDUxCVQ+w+bIlU9Qji+4kH9NtBdFUC2shYDn0s="}]},"directories":{},"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","tarball":"https://registry.npmjs.org/kilt/-/kilt-2.0.0.tgz","integrity":"sha512-WR42MT/83PoNToa9dO2rSBl2dH/ggbbxz2IOzXvEI/nqh2GAK8yPVqaJNsbyCygguKqgJ9DjNhWKDNOL80RP6Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAQA+jGl6xrmBjyHZGJpyK6Hy9tHwFljkmBRHJ2QwbjPAiB79++4kyoMFtKf2gko+kZ5BWC2jcMbDWICpmfTPE6PHg=="}]},"maintainers":[{"name":"hueniverse","email":"eran@hueniverse.com"},{"name":"nexxy","email":"emily@contactvibe.com"}],"directories":{},"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","tarball":"https://registry.npmjs.org/kilt/-/kilt-2.0.1.tgz","integrity":"sha512-8Cwzz3Tcx7Kw9emp9zrEG8p0DaAgKC/Mcnzb9pcfFdVDfrV5ytM7KT0woYuPkIjZEFLmGtmArg7v3/z1XSxohw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCLDTqqBW6KNqvkcwh9TitVZq6LH4GHeYIJe5qo4uODXAIgD+rG2P72eyGxDOmMrt+5BgT7IRUdDwAPFj3I4dqJXag="}]},"maintainers":[{"name":"hueniverse","email":"eran@hueniverse.com"},{"name":"nexxy","email":"emily@contactvibe.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/kilt-2.0.1.tgz_1463813423240_0.3291585866827518"},"directories":{},"deprecated":"This module is no longer maintained."},"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","tarball":"https://registry.npmjs.org/kilt/-/kilt-2.0.2.tgz","integrity":"sha512-quebifoAo/W//XVzUPbHmNBZSxF/ntbYtdr8oYpEfvznmvO+wkR2rrFpGZUvgVdsvqjOvH6mdF0LSUp9qWCBkQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDfDVhL8KngT9dTVA+/Wro1/Upw7Pec34NOYH+Vl6cEpgIhAP1QvTnXjOfrqGiJluuhkri+OOhAivczuGVrZBhEveag"}]},"maintainers":[{"name":"hueniverse","email":"eran@hueniverse.com"},{"name":"nexxy","email":"emily@contactvibe.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/kilt-2.0.2.tgz_1469732194843_0.009429037338122725"},"directories":{},"deprecated":"This module is no longer maintained."}},"homepage":"https://github.com/hapijs/kilt#readme","keywords":["emitter","merge","combine"],"repository":{"type":"git","url":"git://github.com/hapijs/kilt.git"},"bugs":{"url":"https://github.com/hapijs/kilt/issues"},"readmeFilename":"README.md","license":"BSD-3-Clause","users":{"tmurngon":true}}