{"name":"obso","author":{"name":"Lloyd Brookes","email":"75pound@gmail.com"},"version":"0.3.0","repository":{"type":"git","url":"git+https://github.com/75lb/obso.git"},"description":"emitter","module":"emitter.mjs","main":"dist/emitter.js","dependencies":{},"devDependencies":{"jsdoc-to-markdown":"^4.0.1","rollup":"^0.63.4","rollup-plugin-node-resolve":"^3.3.0","rollup-watch":"^4.3.1","test-runner":"^0.5.0","test-runner-counter":"^0.1.2"},"scripts":{"test":"rollup -c dist/emitter.config.js && test-runner test.js","watch":"rollup -c dist/emitter.config.js -w","docs":"jsdoc2md -c jsdoc.conf emitter.mjs > README.md"},"license":"MIT","gitHead":"0a29639f5ceffeda93fdaae080a8dbdcf9702595","bugs":{"url":"https://github.com/75lb/obso/issues"},"homepage":"https://github.com/75lb/obso#readme","_id":"obso@0.3.0","_npmVersion":"6.2.0","_nodeVersion":"10.7.0","_npmUser":{"name":"75lb","email":"75pound@gmail.com"},"dist":{"integrity":"sha512-2z3ftm0lswxaLXW2g9gMO/sazhVjFD+bKKMDSuwySoY4HzP6WcrfzxXPH+xK62CG9UYZt/3dnUq4ggdM1TJ4kA==","shasum":"e8c6565d1a3b35d09261af78168e950a0fbf4fbd","tarball":"http://registry-npm.ywwl.com/obso/download/obso-0.3.0.tgz","fileCount":8,"unpackedSize":10268,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbWN3BCRA9TVsSAnZWagAAkDsQAJ8HLnkJpHj7xSpsCAMt\nfd/CNXNpdGMdufwosI9/dWu3OQwvFXq8gSf3zMbarFVje5ImGWfL4l0nCF3I\nVNbt9+g9aPgxqEDF5SCK8e1bwm0t1fN04mJzntMu6zF7LlV6zRCZTRW2bYtq\n3QXmhOl4b5FkIBGLMD2tnhbHd+foJtCLKbnrzgVPXmHZax1gjEzVvTdRsLFF\nMNQ6f9SH06YV/jPXnwPrQ8k1pGwV9mtPzm5ROX6yy3fHXASxD8beaY6UouSk\n3X3l2M/XZkfOiuPKzRZI+pEU8f9F+J7fKv3T7t6GTweIN14lZpfY+jub43n/\n8RGXa+HCHRcpM5wqmolyKrDLOx6aOoX4ngiRmVYzlB5ilGKkYP0LhYgznd5h\nzuMz4FYGF4vkSN5YPWcEDgoNDX8rJrutYEx+1IxvsKO64WY/IVaH5iXeuiKl\nnJUMvrRlExOp2oDEKQGf0G1vc6CLdJB9ZwaoXEZbNBQSpwcsT5t8qU9tA138\nrlNJU8xt0kOMOCGThNjNDGabzoCQptihUFpdNHNZCbLBpngSfKZ4/ZOwYaz+\nSdtDFqYbCOqwBuUNbJZLM/UYkI1ugqFlbcrCk9r3dUR2uxJ6jAgDzcelgDni\nKT7Xwpjxe77JFmHvoLmgCdtWOlhbI+FLKZMlqjOUZ8tOQ8HoQlzeLT8SpRUg\nySFv\r\n=sRc1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC8KXJC8dy/PstM+74id87zBnIJuC/IxekQGJIbIphpQwIhAPgh/iq6fwxbCYsTSj/hdl1aJSrMnYgt8Ua+N4z80oku"}],"size":2701,"noattachment":false,"key":"/obso/-/obso-0.3.0.tgz"},"maintainers":[{"name":"75lb","email":"75pound@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/obso_0.3.0_1532550593581_0.11803557679328036"},"_hasShrinkwrap":false,"readme":"[![view on npm](https://badgen.net/npm/v/obso)](https://www.npmjs.org/package/obso)\n[![npm module downloads](https://badgen.net/npm/dt/obso)](https://www.npmjs.org/package/obso)\n[![Gihub repo dependents](https://badgen.net/github/dependents-repo/75lb/obso)](https://github.com/75lb/obso/network/dependents?dependent_type=REPOSITORY)\n[![Gihub package dependents](https://badgen.net/github/dependents-pkg/75lb/obso)](https://github.com/75lb/obso/network/dependents?dependent_type=PACKAGE)\n[![Build Status](https://travis-ci.org/75lb/obso.svg?branch=master)](https://travis-ci.org/75lb/obso)\n[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](https://github.com/feross/standard)\n\n# obso\n\nMake an object observable.\n\n```js\nimport Emitter from 'obso/index.mjs'\nclass Something extends Emitter {}\nconst something = new Something()\nsomething.on('load', () => {\n  console.log('load event fired.')\n})\n```\n\n<a name=\"module_obso\"></a>\n\n## obso\n\n* [obso](#module_obso)\n    * [Emitter](#exp_module_obso--Emitter) ⏏\n        * [.addEventListener](#module_obso--Emitter+addEventListener)\n        * [.emit(eventName)](#module_obso--Emitter+emit)\n        * [.on([eventName], handler, [options])](#module_obso--Emitter+on)\n        * [.removeEventListener(eventName, handler)](#module_obso--Emitter+removeEventListener)\n        * [.once(eventName, handler)](#module_obso--Emitter+once)\n\n<a name=\"exp_module_obso--Emitter\"></a>\n\n### Emitter ⏏\n**Kind**: Exported class  \n<a name=\"module_obso--Emitter+addEventListener\"></a>\n\n#### emitter.addEventListener\nAlias for `on`.\n\n**Kind**: instance property of [<code>Emitter</code>](#exp_module_obso--Emitter)  \n<a name=\"module_obso--Emitter+emit\"></a>\n\n#### emitter.emit(eventName)\nEmit an event.\n\n**Kind**: instance method of [<code>Emitter</code>](#exp_module_obso--Emitter)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| eventName | <code>string</code> | the event name to emit. |\n| ...args | <code>\\*</code> | args to pass to the event handler |\n\n<a name=\"module_obso--Emitter+on\"></a>\n\n#### emitter.on([eventName], handler, [options])\nRegister an event listener.\n\n**Kind**: instance method of [<code>Emitter</code>](#exp_module_obso--Emitter)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| [eventName] | <code>string</code> | The event name to watch. Omitting the name will catch all events. |\n| handler | <code>function</code> | The function to be called when `eventName` is emitted. Invocated with `this` set to `emitter`. |\n| [options] | <code>object</code> |  |\n| [options.once] | <code>boolean</code> | If `true`, the handler will be invoked once then removed. |\n\n<a name=\"module_obso--Emitter+removeEventListener\"></a>\n\n#### emitter.removeEventListener(eventName, handler)\nRemove an event listener.\n\n**Kind**: instance method of [<code>Emitter</code>](#exp_module_obso--Emitter)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| eventName | <code>string</code> | the event name |\n| handler | <code>function</code> | the event handler |\n\n<a name=\"module_obso--Emitter+once\"></a>\n\n#### emitter.once(eventName, handler)\nOnce.\n\n**Kind**: instance method of [<code>Emitter</code>](#exp_module_obso--Emitter)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| eventName | <code>string</code> | the event name to watch |\n| handler | <code>function</code> | the event handler |\n\n\n### Load anywhere\n\nThis library is compatible with Node.js, the Web and any style of module loader. It can be loaded anywhere, natively without transpilation.\n\nNode.js:\n\n```js\nconst Emitter = require('obso')\n```\n\nWithin Node.js with ECMAScript Module support enabled:\n\n```js\nimport Emitter from 'obso/index.mjs'\n```\n\nWithin an modern browser ECMAScript Module:\n\n```js\nimport Emitter from './node_modules/obso/index.mjs'\n```\n\nOld browser (adds `window.Emitter`):\n\n```html\n<script nomodule src=\"./node_modules/obso/dist/index.js\"></script>\n```\n\n* * *\n\n&copy; 2018-21 Lloyd Brookes \\<75pound@gmail.com\\>. Documented by [jsdoc-to-markdown](https://github.com/jsdoc2md/jsdoc-to-markdown).\n","publish_time":1532550593641,"_cnpm_publish_time":1532550593641,"dist-tags":{"latest":"0.7.0"}}