{"name":"obso","author":{"name":"Lloyd Brookes","email":"75pound@gmail.com"},"version":"0.6.0","repository":{"type":"git","url":"git+https://github.com/75lb/obso.git"},"description":"Make an object observable.","main":"dist/index.js","module":"index.mjs","engines":{"node":">=8"},"dependencies":{},"devDependencies":{"jsdoc-to-markdown":"^5.0.3","rollup":"^2.7.6","test-runner":"^0.8.13"},"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":"a18fc2097030c9eb4f159273cdb6aa6ec32d530f","bugs":{"url":"https://github.com/75lb/obso/issues"},"homepage":"https://github.com/75lb/obso#readme","_id":"obso@0.6.0","_nodeVersion":"14.1.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-VEgWrXZNw5H8aXCuyXjEP1ngwCtI4iG75ipzZNMd23GVmmzSvA8xs1AzupkYz9Cp35Uu4d+BTTEmvEJ3tSkcWQ==","shasum":"26d398017d0e9977e44936e52208ed1f4cd65ff9","tarball":"http://registry-npm.ywwl.com/obso/download/obso-0.6.0.tgz","fileCount":6,"unpackedSize":14105,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJerFcDCRA9TVsSAnZWagAAw5UP/j2NTvmaZFluOJzM0y3t\n3vEx3PH/AUktbANyA8UbU74wBiZHBjJEKs/FFEiGJFaiVpdeViUwI3zIehaY\ncrVHtl3a1BrXePpjGttHBT8fC6/s0xzRTbyKgB2W6Z8ADJKdTN0bKWH7Vz6z\nGfyv2/jxhST5O3nDjOBUNxhUlUlmHzaIhmcZQq2+9zUJkIYu4TOSysMTGf79\n+HO7fTwKlgpkFIV41QJyVUkKR7FyW/ICWRf8IRfSDCRU9vaSd49JtcwYOidE\n/omjap+X/YwvCcN4E7/WMk87spzt9fCeBszejCc878uq7DabemtimIl3YwGe\nSxIL39/HRmzmr7PBFivTtH/o7XsSY1lWQExQd+hj8m1nTsNFHZvAxWOpqAGf\nGlngOvyFcya8DZaCIUIRC/kW/XBjGG9pTdt42/0Ghcl1vrFouXV4MNRbdkSe\nTWBHeWdUNFwT+loOsjO7XDzOWsG0Ya//K0rShOb0E12uT6YRZO+NFaY540TA\npmjW49Or6MLGZmo0q+PwZdhiheYmkfZWL1CU2W382agUjZhX6tWc11O25ijt\n89VwWihdWDC1kEhftaxo1qwk+2U5Rh6Ry4np1MLnfZEDt7MELR74crbxkw4V\nwUN+qoG52mk+vzfJAaImAhNu9ueNzyRr6AQ8QLMWsPtNm7tGMWRKkI67kO2D\n4h/J\r\n=q44A\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDiRYNza7MNrg2Qnlvv87Yl41/iJdUreIekqr/IS8zljgIgPlImBnb3+5OwRAJ/GM2O78plSROdg38xYD3uIe3eZZo="}],"size":3484,"noattachment":false,"key":"/obso/-/obso-0.6.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.6.0_1588352769791_0.6663048853505997"},"_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":1588352769896,"_cnpm_publish_time":1588352769896,"dist-tags":{"latest":"0.7.0"}}