{"name":"obso","author":{"name":"Lloyd Brookes","email":"75pound@gmail.com"},"version":"0.4.0","repository":{"type":"git","url":"git+https://github.com/75lb/obso.git"},"description":"obso","main":"dist/index.js","engines":{"node":">=6.0.0"},"dependencies":{},"devDependencies":{"jsdoc-to-markdown":"^4.0.1","rollup":"^0.68.2","test-runner":"^0.5.1","test-runner-counter":"^0.1.2"},"scripts":{"test":"rollup -c dist/index.config.js && test-runner test.js","dist":"rollup -c dist/index.config.js -w","docs":"jsdoc2md -c jsdoc.conf -t README.hbs index.mjs > README.md"},"license":"MIT","gitHead":"863950d454a96a5bd2435883f49b1a9671af54bb","bugs":{"url":"https://github.com/75lb/obso/issues"},"homepage":"https://github.com/75lb/obso#readme","_id":"obso@0.4.0","_npmVersion":"6.5.0","_nodeVersion":"11.5.0","_npmUser":{"name":"75lb","email":"75pound@gmail.com"},"dist":{"integrity":"sha512-lfDdQ98LvbN/8odZR0vV5Ox0OvCq/hd15rW+kL4WbbdxazRhD8Oe1u8zVrckoWvXPVQUvKD0PYi836kYtYZINQ==","shasum":"bd4c2302b218d00795e0014c0a69ba57b1e09ec4","tarball":"http://registry-npm.ywwl.com/obso/download/obso-0.4.0.tgz","fileCount":9,"unpackedSize":16961,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcIS56CRA9TVsSAnZWagAATxcP/06jdPMsHlCdUfY449ze\nnAPOZ180UC2u9poAAr0BclR+UXT+8QjYMviGRmW6mPx7fCgWQ31mX4Y5iJWk\ngMTWrHwYokGofD8/Ixx594/B0VcpnYsscYtkaluzwkj4JDDlawkobsX7RyD4\nBGzcU5GkGAHGk9ENCivd9I0DKepdiogSLSbbQECFPKoUZX44gTlBg9wlkjAl\nVzkMTe/4hglHDYLg8jNX6OFt/4iXrQwP4byYNrGmTrqIOX5iO42BSKLIXOGl\nOnqZ8YwRbbY7DJPNBmyZUU1pVz21b1LkgitHbpOWkSmgKaoh+u80C2QOXabR\nXQvjg4+ceYcMPoJ/E7wdcPmPfjDrBrNcy+5kNN+o5YGy553DR2HTpPP3COfX\nE4WYsTutLbddSu81pks1YInJeaNUKTUES2/sm4ln13NFub+W62v63+Ql7gFn\nPGkHUbBtOvp8/qgG2scUgW3v1s4ZcutndsiGOpbCoqu3B+q+xpy53gOKp1A3\nN+0LGCZB5swBNcroSXJolc9+ZR/GG7F/YUxgOHhCG+wjf44BHqZDAJSgQGFB\nRj6vnn/8DmI3xOfisceTJrxldMnkI7kqs057KV7oENG+gQz+CyUnLPKFERdY\nBXS3F4zIYtnf+sKxMMflytfXZ/ReqOv/wd7F0TAash6ckNbQxo9rHp6EZi3/\nb05o\r\n=nX17\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCrNGT4vJPCEkKtI6We1t3lxAWEk+6rric2rjj2DpKzdgIgBMbufDORbS3sInqTxzoggXgJ9IsisVcG6FVuQy6+PaI="}],"size":3509,"noattachment":false,"key":"/obso/-/obso-0.4.0.tgz"},"maintainers":[{"name":"75lb","email":"75pound@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/obso_0.4.0_1545678457703_0.7353797365369581"},"_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":1545678457844,"_cnpm_publish_time":1545678457844,"dist-tags":{"latest":"0.7.0"}}