{"name":"@servie/events","version":"3.0.0","publishConfig":{"access":"public"},"description":"Tiny type-safe event emitter","license":"MIT","repository":{"type":"git","url":"git://github.com/serviejs/events.git"},"author":{"name":"Blake Embrey","email":"hello@blakeembrey.com","url":"http://blakeembrey.me"},"homepage":"https://github.com/serviejs/events","bugs":{"url":"https://github.com/serviejs/events/issues"},"main":"dist/index.js","scripts":{"format":"ts-scripts format","lint":"ts-scripts lint","prepare":"ts-scripts install && ts-scripts build","size":"size-limit","specs":"ts-scripts specs","test":"ts-scripts test && npm run size"},"keywords":["events","emitter","types","typescript","micro"],"devDependencies":{"@borderless/ts-scripts":"^0.3.0","@size-limit/preset-small-lib":"^4.10.2","@types/jest":"^26.0.22","@types/node":"^14.14.37","size-limit":"^4.10.2","typescript":"^4.2.4"},"types":"dist/index.d.ts","sideEffects":false,"size-limit":[{"path":"dist/index.js","limit":"200 B"}],"gitHead":"c4e55234204cd9e5a77c6698dce918ac08fc5b43","_id":"@servie/events@3.0.0","_nodeVersion":"15.14.0","_npmVersion":"7.9.0","dist":{"integrity":"sha512-Zd79bWhTuG8NvPgSiOcivorJIDg+goMw76TIqYTIR5ua5HOEkS29fmIh2VVSeDeabNF6z8ceTwzB0pSh/BhXyw==","shasum":"89863ae789248976be0565558dd420d3b8753bd0","tarball":"http://registry-npm.ywwl.com/@servie/events/download/@servie/events-3.0.0.tgz","fileCount":9,"unpackedSize":21022,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdh58CRA9TVsSAnZWagAAQIIP/3tEezFb8J5LEBGNI7nP\nYGsV/FGRN7BP5ABWFrQsoetLkJiekiAdbyTM6tqKxPpzrcFeFQ4LQzJUNBFZ\nfrIZt2wnH2DbU4pHcw7gE4s2U/ROB4orO5eckt9ZInezClNga10IXDAg/lXY\n/hWEks0BBr7jqsDbhzPgnLBvHse0wf2mIAaduWWD6KN6KT5BSr7gFycTcUGN\nOR08jlS+P+HS57v4+uFkeUONd6dVoKjnn1tP8hWSXhRMaOhJ0zRQpuzUTfYm\nhXEpgQJl3RyXh+VOL/8z/aVrI8cD9XE0kWHLoSR+bs9J9MTtZbZV2oI/dbMn\n6uQveyNL2FlVU9LVHCxNCa3hk/T7ymEOGI9OP0WCuXFmaCE7YgU6NDUU7a6O\nhGufJtWygbf5pNN7uRyy1ys1jaciLISNjYRdsBSQ/H1w5IFa6uKnDZvxupN/\nSVQLTFw2w0bXXvUZP/UcZXQtCMgTaTAc2ftM/61rMgGbDEHoH9ZnWAuzV5ws\nI0rS338VmRaSiEQO/f0svlKKkaRLm/xQNPKJpM6f7M7pGbF9gDbCm7DV//Di\nEx5d0mWeF2FQFz3WkCBOsSFmvsjJj6A1dZmgiJEBRUe4PzuoGIspKikmKNAQ\n2324PL/XEXujMZEEq0rPZ3nX6zF1rOVFqOforZ5lSCqT1mt1Y+rhTb2hvgk3\nG68N\r\n=PKFR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCBXOXZnPxUDyQB+QT5GSFXt5GSNsXGj/9cwPz6QL2NKgIhAL2rgk9XaG+4OdQFceEgV0mHpzwyveXGH5wh30aQBHaw"}],"size":5275,"noattachment":false,"key":"/@servie/events/-/@servie/events-3.0.0.tgz"},"_npmUser":{"name":"blakeembrey","email":"hello@blakeembrey.com"},"directories":{},"maintainers":[{"name":"blakeembrey","email":"hello@blakeembrey.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/events_3.0.0_1618353787878_0.3047873361550706"},"_hasShrinkwrap":false,"readme":"# Events\n\n[![NPM version][npm-image]][npm-url]\n[![NPM downloads][downloads-image]][downloads-url]\n[![Build status][build-image]][build-url]\n[![Build coverage][coverage-image]][coverage-url]\n[![Bundle size][bundlephobia-image]][bundlephobia-url]\n\n> Tiny type-safe event emitter.\n\n## Installation\n\n```\nnpm install @servie/events --save\n```\n\n## Usage\n\n```ts\nimport { Emitter, once, ALL_EVENTS } from \"@servie/events\";\n\n// Define an events interface using keys & argument tuples.\ninterface Events {\n  test: [boolean];\n  other: [string];\n}\n\n// Initialize an `Emitter` using your `Events` interface.\nconst events = new Emitter<Events>();\n\n// Add or remove listeners.\nconst listener = (...args) => console.log(args);\nconst off = events.on(\"test\", listener);\n\n// Emit an event.\nevents.emit(\"test\", true);\n\n// Listen to _all_ events, i.e. for debugging.\nconst eachListener = ({ type, args }) => console.log(type, args);\nconst off = events.on(ALL_EVENTS, eachListener);\n\n// \"Once\" utility.\nconst runOnce = (...args) => console.log(args);\nonce(events, \"test\", runOnce);\n\n// Remove the listener.\noff();\n```\n\n## TypeScript\n\nThis project is written using [TypeScript](https://github.com/Microsoft/TypeScript) and publishes the definitions directly to NPM.\n\n## License\n\nMIT\n\n[npm-image]: https://img.shields.io/npm/v/@servie/events\n[npm-url]: https://npmjs.org/package/@servie/events\n[downloads-image]: https://img.shields.io/npm/dm/@servie/events\n[downloads-url]: https://npmjs.org/package/@servie/events\n[build-image]: https://img.shields.io/github/workflow/status/serviejs/events/CI/main\n[build-url]: https://github.com/serviejs/events/actions/workflows/ci.yml?query=branch%3Amain\n[coverage-image]: https://img.shields.io/codecov/c/gh/serviejs/events\n[coverage-url]: https://codecov.io/gh/serviejs/events\n[bundlephobia-image]: https://img.shields.io/bundlephobia/minzip/@servie/events.svg\n[bundlephobia-url]: https://bundlephobia.com/result?p=@servie/events\n","publish_time":1618353788067,"_cnpm_publish_time":1618353788067,"dist-tags":{"latest":"3.0.0"}}