{"_id":"emitter-only","_rev":"3-063c8cab636e250c249788973662fc48","name":"emitter-only","description":"Extend event emitters to allow registering listeners only once.","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"emitter-only","description":"Extend event emitters to allow registering listeners only once.","version":"0.1.0","homepage":"https://github.com/doowb/emitter-only","author":{"name":"Brian Woodward","url":"https://github.com/doowb"},"repository":{"type":"git","url":"git+https://github.com/doowb/emitter-only.git"},"bugs":{"url":"https://github.com/doowb/emitter-only/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"devDependencies":{"component-emitter":"^1.2.0","mocha":"*","should":"^7.1.0"},"dependencies":{"define-property":"^0.2.5"},"verb":{"related":{"list":["component-emitter"]}},"gitHead":"66b87897f74e44beae956a2aa0d0350f57ae2e89","_id":"emitter-only@0.1.0","_shasum":"8d128f43eb6a85af690f29ec256755b3bed69076","_from":".","_npmVersion":"2.13.3","_nodeVersion":"0.12.0","_npmUser":{"name":"doowb","email":"brian.woodward@gmail.com"},"dist":{"shasum":"8d128f43eb6a85af690f29ec256755b3bed69076","tarball":"https://registry.npmjs.org/emitter-only/-/emitter-only-0.1.0.tgz","integrity":"sha512-jDEPYPNZOH5hD5RrZ3II7/gztvSFXJP7Zmui+mvvVVwf51uUeZv2LXPx6US7OfsPnCWjwKAuuEWrbl9Ba9y5BQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCMJ/a481epqzgo9EbZgc99Z5+bIcQ6YMOR4Uo3ZxXoYQIgUNWfuDWQSUlEaD+cOHywtn672KunfeROJRVVnD8XmyI="}]},"maintainers":[{"name":"doowb","email":"brian.woodward@gmail.com"}]}},"readme":"# emitter-only [![NPM version](https://badge.fury.io/js/emitter-only.svg)](http://badge.fury.io/js/emitter-only)  [![Build Status](https://travis-ci.org/doowb/emitter-only.svg)](https://travis-ci.org/doowb/emitter-only)\n\n> Extend event emitters to allow registering listeners only once.\n\nInstall with [npm](https://www.npmjs.com/)\n\n```sh\n$ npm i emitter-only --save\n```\n\n## Usage\n\n```js\nvar only = require('emitter-only');\n```\n\n## API\n\n### [only](index.js#L39)\n\nOnly register an event listener one time for the given `name/event` combo.\n\n**Params**\n\n* `name` **{String}**: Name to specify this is a unique listener.\n* `event` **{String}**: Event name to pass to the emitter `on` method.\n* `fn` **{Function}**: Event listener function to pass to the emitter `on` method.\n* `returns` **{Object}**: Return `this` for chaining.\n\n**Example**\n\n```js\nEmitter.prototype.only = function () {\n  return only.apply(this, arguments);\n};\n\nvar emitter = new Emitter();\nemitter.only('one-time', 'foo', function (msg) {\n  console.log('foo 1', msg);\n});\n\nemitter.only('one-time', 'foo', function (msg) {\n  console.log('foo 2', msg);\n});\n\nemitter.emit('foo', 'bar');\n//=> 'foo bar'\n```\n\n## Related projects\n\n[component-emitter](https://www.npmjs.com/package/component-emitter): Event emitter | [homepage](https://github.com/component/emitter)\n\n## Running tests\n\nInstall dev dependencies:\n\n```sh\n$ npm i -d && npm test\n```\n\n## Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/doowb/emitter-only/issues/new).\n\n## Author\n\n**Brian Woodward**\n\n+ [github/doowb](https://github.com/doowb)\n+ [twitter/doowb](http://twitter.com/doowb)\n\n## License\n\nCopyright © 2015 Brian Woodward\nReleased under the MIT license.\n\n***\n\n_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on September 23, 2015._","maintainers":[{"name":"doowb","email":"brian.woodward@gmail.com"}],"time":{"modified":"2022-06-17T01:59:24.341Z","created":"2015-09-23T20:43:54.567Z","0.1.0":"2015-09-23T20:43:54.567Z"},"homepage":"https://github.com/doowb/emitter-only","repository":{"type":"git","url":"git+https://github.com/doowb/emitter-only.git"},"author":{"name":"Brian Woodward","url":"https://github.com/doowb"},"bugs":{"url":"https://github.com/doowb/emitter-only/issues"},"license":"MIT","readmeFilename":"README.md"}