{"name":"obso","author":{"name":"Lloyd Brookes","email":"75pound@gmail.com"},"version":"0.7.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":">=14"},"devDependencies":{"jsdoc-to-markdown":"^7.0.0","rollup":"^2.42.1","test-runner":"^0.8.14"},"scripts":{"test":"npm run dist && test-runner test.mjs","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":"8220f277463e94c44211c41385423e00e636b7cd","bugs":{"url":"https://github.com/75lb/obso/issues"},"homepage":"https://github.com/75lb/obso#readme","_id":"obso@0.7.0","_nodeVersion":"15.12.0","_npmVersion":"7.6.3","dist":{"integrity":"sha512-iNEHV1r9hFfemR0jFUIxFxqkR9rcvY10C7U/LtKM2w5wS3nSLZEqRnfGY/P8cYzCXHTzTefxMYfnIJkssDhmAg==","shasum":"92a0e7d6963c0420ba2d2e5996a4bffae2899594","tarball":"http://registry-npm.ywwl.com/obso/download/obso-0.7.0.tgz","fileCount":6,"unpackedSize":15614,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgVmuFCRA9TVsSAnZWagAABS4P/2l+BWBbsDdhyAAYFD29\n4o4fuJw42moQOXegd9yJXtpj4aKz0YGtdNqVQhqJvr1frTB2eq/Z5csCWD8S\nLhZmPHvmOeSIZG3yEA7YFeVYp94nFJ23xFLICiaAKWQwzD6lgV5Fo2xI0qPL\no4VLAhpUzxM6bv/46wAyGW74JLjtvomFguYTbf72mYpQqFDQuuuzVh/HKgpR\nwY2gTeSiouOpo7XTef+9gZpnq2v2uXIFQLJc6pD5tKfzl4o29ZFuSiK5yvKt\nT+a4szOIi8U/5vjQXsTcr1y6Fp/TMZhcIvc8srWyHr3yaoNf7OFTk2jGCvyy\nFbLs0L6Sp3J4h/VYXkqhEbmpjOy7xEbDKCIEmuJidXDSGGWR/Tn+5kQ3ZuND\nMuOPYCj+LmBolP+xM9/8ZY4A8RQob2z3ZuUJPpPYqX9Pi4OV1ueSVJt95P4v\nmDkYsLjNo02n2BCLpLJJ7tuNpHk15VjwUIiJ2MHUZQoqKkwXOVy0gzJogCul\najjdELCLOcLGEx7+4vyA6Z+dIjvMuodnU9HNRSXNZVX4PQenljFtULGb6vhN\nq5j0BIF2OBVu3FEo6PZPb3n3BUh/Acbvd9sllrj5R+sQPqNTdzn1lPAhNORJ\n0JqneRiOgAoX2BINl9pYzpk52b7b2tUeQv489QHP76tl0G137Qr1Q4N+laah\nWbML\r\n=mDqm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD4KXfglpv90o8JYvw5KMMHRx0IhotPIa8ziUXmWZGBuwIgW0KpdXjtXcly6+0b/Uxdisut/Sqb7k/2/mOT4pQzp8o="}],"size":3739,"noattachment":false,"key":"/obso/-/obso-0.7.0.tgz"},"_npmUser":{"name":"75lb","email":"75pound@gmail.com"},"directories":{},"maintainers":[{"name":"75lb","email":"75pound@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/obso_0.7.0_1616276356687_0.8654704292267195"},"_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":1616276356858,"_cnpm_publish_time":1616276356858,"dist-tags":{"latest":"0.7.0"}}