{"name":"obso","author":{"name":"Lloyd Brookes","email":"75pound@gmail.com"},"version":"0.5.0","repository":{"type":"git","url":"git+https://github.com/75lb/obso.git"},"description":"obso","main":"dist/index.js","engines":{"node":">=8"},"dependencies":{},"devDependencies":{"jsdoc-to-markdown":"^5.0.1","rollup":"^1.20.3","test-runner":"^0.6.0"},"scripts":{"test":"npm run dist && test-runner test.js","dist":"rollup -f umd -n Emitter -o dist/index.js index.mjs","docs":"jsdoc2md -c jsdoc.conf -t README.hbs index.mjs > README.md"},"license":"MIT","gitHead":"a014cd79b689b38db25a6e546d973edb9dabfdac","bugs":{"url":"https://github.com/75lb/obso/issues"},"homepage":"https://github.com/75lb/obso#readme","_id":"obso@0.5.0","_nodeVersion":"12.9.1","_npmVersion":"6.11.3","dist":{"integrity":"sha512-OIPLscoyq1SRCbbp6VlBWrzG+zR8T8tkic4rHuqABgTYlgqEvvzE5KclPa5sh/jy9x59en9K9JAQFa9ZV8xbVg==","shasum":"002c62f321a7f57567839f2cac552b833150742e","tarball":"http://registry-npm.ywwl.com/obso/download/obso-0.5.0.tgz","fileCount":6,"unpackedSize":15340,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdb851CRA9TVsSAnZWagAAki4P/2r8F1GkqNs5/YOwhqgR\nje7KNPDhii+MJTTOS6F2rh4dqVmuA0N/EQrSBLfKERN+6NB2XAs5GSsiH+/N\ndMfjrmRgDQRCw3+VjKR3wbAFE0AC45ZjZjcNYJ7JQCP3/8Q9s3JmgODZxJMx\nXbAEI0zmfa/KZhEwKCpmTPPjsr5swysNGxjFPI5Yh0ry/YLdZIQ7C3CcJFpT\n/ezlnqXEemrf28u3Pyxb2N4P039vl7MmJwIN47Z4/g6bwPPSSP3yEr7zOFem\nmzR+Wb/VoUG/j6GjWIt7qch3/v5XvpU5DlJgQAQoOqxnh8kLZ5TwfdBES51n\niuTSwDVL7FbRUQzEGDg10zNmT546TaSeSyhDWPcpm3hBVJlC748hfT2ESMLr\n1+jZNfZzk1H8m4shWD+bApKH/5cq/dWA2eHgkVRbQyBCWG0dfz4tm/EXEW8i\nWf7hDZBFFWlYwPQ0RIdU2ZgZS75fkgtzSinK/9RDhKbaECYK5Xipt/2smPIc\ndpT300fVxFU/57mpWgkmK+AAnkUjDk5jKjIQvQrh2hk2MJTt2Ax3/sszrIba\nxTLbmgjtzHLDkNzsctqjP3PC1pEyVVi0Y317ciV36P6jRch4cNYlXLn37GZK\n4XZ+R7DtMspOJbUDXhHE//PybAKaM1mmoVXxnBp+bdX0KyGFkXz0byOPMkgL\nkVkw\r\n=18N9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGOuJFSBJXaNOsfeGpE9qcGOYdQEP4YF8Z2WT2VHL0WPAiEAoU9aP4F8HGrVie/yhJEdNmxKvQUBv7iEOrDqSFNIl0g="}],"size":3684,"noattachment":false,"key":"/obso/-/obso-0.5.0.tgz"},"maintainers":[{"name":"75lb","email":"75pound@gmail.com"}],"_npmUser":{"name":"75lb","email":"75pound@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/obso_0.5.0_1567608436889_0.4317296990792969"},"_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":1567608436993,"_cnpm_publish_time":1567608436993,"dist-tags":{"latest":"0.7.0"}}