{"_id":"@ashish-hurix/event-emitter","_rev":"1-0895baef54a02e8debe30644217cd927","name":"@ashish-hurix/event-emitter","dist-tags":{"latest":"0.3.6"},"versions":{"0.3.6":{"name":"@ashish-hurix/event-emitter","version":"0.3.6","description":"Environment agnostic event emitter forked from mediko","author":{"name":"Ashish Yadav","email":"ashish.hurix@outlook.com"},"keywords":["event","events","trigger","observer","listener","emitter","pubsub"],"repository":{"type":"git","url":"git://github.com/ashish-hurix/event-emitter.git"},"dependencies":{"d":"^1.0.1","es5-ext":"^0.10.50"},"devDependencies":{"tad":"^2.0.1","xlint":"^0.2.2","xlint-jslint-medikoo":"^0.1.4"},"scripts":{"lint":"node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --no-cache --no-stream","lint-console":"node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --watch","test":"node ./node_modules/tad/bin/tad"},"license":"MIT","gitHead":"1c7473808e67ab7d46c9e66abdec70e680659914","bugs":{"url":"https://github.com/ashish-hurix/event-emitter/issues"},"homepage":"https://github.com/ashish-hurix/event-emitter#readme","_id":"@ashish-hurix/event-emitter@0.3.6","_nodeVersion":"14.18.2","_npmVersion":"6.14.15","dist":{"integrity":"sha512-Nj5E5APY+HJQcO/EPMP8eBRmlXYSNFMWnp+XWqWLb75L2akd5KHoCLKHNHFi32xL4g8V55BQNOZ2jprzoWXnFg==","shasum":"8eb92a07ecc8c15fc02f7cca382dd3cdf610af29","tarball":"https://registry.npmjs.org/@ashish-hurix/event-emitter/-/event-emitter-0.3.6.tgz","fileCount":23,"unpackedSize":29202,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiA/pKCRA9TVsSAnZWagAAwCoP/2dz/lQPijIuhgzjEJr3\ntz0klJ2WTOwyzf+Rb+FYDmWIAZ9NBalBWZlii9z+sj/qPa8eh5Yr3W7UwsV6\nJUVYebmB5cS4lySGKhugrzHgfafrYpCUZuiKj1xDXqGQYNmWV0vSoo6vR8F8\ndl7URCq60DhkpaU23Slso06G6tsr5vL11eNG6GRXSMRktb3aUGV6pAoRxoUq\nFIWC7E6FMddn6JKgJJ0WqUJ/quvyRZeg1r3KQ2oEhfjllUG9poCk7pamTwqi\nvEBCj3zXSMOGsDXKLmf3GRPcr6NEuh4xdcE2OxL5LaFzlV6v7jGemPu49q1Y\n8uCBD8nxPn0dv+Ke1u57FPGwhzDCoc+ZRBkG4cZl7/PR+d803r/jqwtO4lP3\nf21HfCGI6C/QPls1rE4/3XBU+GUeBXi0xFs0tXtZyR6E+WnBoS2pfPT0aCKl\nl8Bz/gEFYjwe+1eKYoHJXG/cEaNwnQoay2zl+C8pFGJwfHOMTWnMLEaScUNf\nKssXDR17470+SUvO/UPB9vtMKjp4X6sbw6LNPiR94Jvifhm5ud1cUfydhtKJ\nmjieODovCUvR/moNAbN2Syk3ELQPWa/KTmNSRHGfTnc1etWGkZKIop5Ks2ng\nKtr8RYIY9nrIatbN7RRXnji/KGscKwusPvJCwutErTWx+AYq5Td12OC1WdA8\nR868\r\n=Ox2D\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDhaN+7olnfhdNJvQ61PSjIKDVcjyjO3xJ4juAr8KTQrgIgNuiDUhQZyFwIzjqlA2xFBNBwlqqPS7Qe/Y40d8zLkIk="}]},"_npmUser":{"name":"ashish-hurix","email":"ashish.hurix@outlook.com"},"directories":{},"maintainers":[{"name":"ashish-hurix","email":"ashish.hurix@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/event-emitter_0.3.6_1644427850723_0.7254465215678785"},"_hasShrinkwrap":false}},"time":{"created":"2022-02-09T17:30:50.677Z","0.3.6":"2022-02-09T17:30:50.854Z","modified":"2022-04-04T15:45:30.754Z"},"maintainers":[{"name":"ashish-hurix","email":"ashish.hurix@outlook.com"}],"description":"Environment agnostic event emitter forked from mediko","homepage":"https://github.com/ashish-hurix/event-emitter#readme","keywords":["event","events","trigger","observer","listener","emitter","pubsub"],"repository":{"type":"git","url":"git://github.com/ashish-hurix/event-emitter.git"},"author":{"name":"Ashish Yadav","email":"ashish.hurix@outlook.com"},"bugs":{"url":"https://github.com/ashish-hurix/event-emitter/issues"},"license":"MIT","readme":"# event-emitter\r\n## Environment agnostic event emitter\r\n\r\n### Installation\r\n\r\n\t$ npm install event-emitter-js\r\n\r\nTo port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: [Browserify](http://browserify.org/), [Webmake](https://github.com/medikoo/modules-webmake) or [Webpack](http://webpack.github.io/)\r\n\r\n### Usage\r\n\r\n```javascript\r\nvar ee = require('event-emitter');\r\n\r\nvar MyClass = function () { /* .. */ };\r\nee(MyClass.prototype); // All instances of MyClass will expose event-emitter interface\r\n\r\nvar emitter = new MyClass(), listener;\r\n\r\nemitter.on('test', listener = function (args) {\r\n  // … react to 'test' event\r\n});\r\n\r\nemitter.once('test', function (args) {\r\n  // … react to first 'test' event (invoked only once!)\r\n});\r\n\r\nemitter.emit('test', arg1, arg2/*…args*/); // Two above listeners invoked\r\nemitter.emit('test', arg1, arg2/*…args*/); // Only first listener invoked\r\n\r\nemitter.off('test', listener);              // Removed first listener\r\nemitter.emit('test', arg1, arg2/*…args*/); // No listeners invoked\r\n\r\nemitter.off('test'); // Remove all listners by type\r\nemitter.off(); // Remove all listeners at once\r\n```\r\n### Additional utilities\r\n\r\n#### allOff(obj) _(event-emitter/all-off)_\r\n\r\nRemoves all listeners from given event emitter object\r\n\r\n#### hasListeners(obj[, name]) _(event-emitter/has-listeners)_\r\n\r\nWhether object has some listeners attached to the object.\r\nWhen `name` is provided, it checks listeners for specific event name\r\n\r\n```javascript\r\nvar emitter = ee();\r\nvar hasListeners = require('event-emitter/has-listeners');\r\nvar listener = function () {};\r\n\r\nhasListeners(emitter); // false\r\n\r\nemitter.on('foo', listener);\r\nhasListeners(emitter); // true\r\nhasListeners(emitter, 'foo'); // true\r\nhasListeners(emitter, 'bar'); // false\r\n\r\nemitter.off('foo', listener);\r\nhasListeners(emitter, 'foo'); // false\r\n```\r\n\r\n#### pipe(source, target[, emitMethodName]) _(event-emitter/pipe)_\r\n\r\nPipes all events from _source_ emitter onto _target_ emitter (all events from _source_ emitter will be emitted also on _target_ emitter, but not other way).  \r\nReturns _pipe_ object which exposes `pipe.close` function. Invoke it to close configured _pipe_.  \r\nIt works internally by redefinition of `emit` method, if in your interface this method is referenced differently, provide its name (or symbol) with third argument.\r\n\r\n#### unify(emitter1, emitter2) _(event-emitter/unify)_\r\n\r\nUnifies event handling for two objects. Events emitted on _emitter1_ would be also emitted on _emitter2_, and other way back.  \r\nNon reversible.\r\n\r\n```javascript\r\nvar eeUnify = require('event-emitter/unify');\r\n\r\nvar emitter1 = ee(), listener1, listener3;\r\nvar emitter2 = ee(), listener2, listener4;\r\n\r\nemitter1.on('test', listener1 = function () { });\r\nemitter2.on('test', listener2 = function () { });\r\n\r\nemitter1.emit('test'); // Invoked listener1\r\nemitter2.emit('test'); // Invoked listener2\r\n\r\nvar unify = eeUnify(emitter1, emitter2);\r\n\r\nemitter1.emit('test'); // Invoked listener1 and listener2\r\nemitter2.emit('test'); // Invoked listener1 and listener2\r\n\r\nemitter1.on('test', listener3 = function () { });\r\nemitter2.on('test', listener4 = function () { });\r\n\r\nemitter1.emit('test'); // Invoked listener1, listener2, listener3 and listener4\r\nemitter2.emit('test'); // Invoked listener1, listener2, listener3 and listener4\r\n```\r\n\r\n### Tests [![Build Status](https://travis-ci.org/medikoo/event-emitter.png)](https://travis-ci.org/medikoo/event-emitter)\r\n\r\n\t$ npm test\r\n\r\n## Security contact information\r\n\r\nTo report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure.\r\n\r\n---\r\n\r\n<div align=\"center\">\r\n\t<b>\r\n\t\t<a href=\"https://tidelift.com/subscription/pkg/npm-event-emitter?utm_source=npm-event-emitter&utm_medium=referral&utm_campaign=readme\">Get professional support for d with a Tidelift subscription</a>\r\n\t</b>\r\n\t<br>\r\n\t<sub>\r\n\t\tTidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.\r\n\t</sub>\r\n</div>\r\n","readmeFilename":"README.md"}