{"name":"@servie/events","version":"1.0.0","description":"Tiny type-safe event emitter","main":"dist/index.js","types":"dist/index.d.ts","sideEffects":false,"scripts":{"prettier":"prettier --write","lint":"tslint \"src/**/*.ts\" --project tsconfig.json","format":"npm run prettier -- README.md \"src/**/*.{js,ts}\"","build":"rimraf dist && tsc","specs":"jest --coverage","test":"npm run lint && npm run build && npm run specs && npm run size","size":"size-limit","prepare":"npm run build"},"repository":{"type":"git","url":"git://github.com/serviejs/tinyevents.git"},"keywords":["events","emitter","types","typescript","micro"],"author":{"name":"Blake Embrey","email":"hello@blakeembrey.com","url":"http://blakeembrey.me"},"license":"MIT","bugs":{"url":"https://github.com/serviejs/tinyevents/issues"},"homepage":"https://github.com/serviejs/tinyevents","size-limit":[{"path":"dist/index.js","limit":"200 B"}],"jest":{"roots":["<rootDir>/src/"],"transform":{"\\.tsx?$":"ts-jest"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(tsx?|jsx?)$","moduleFileExtensions":["ts","tsx","js","jsx","json","node"]},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{js,json,css,md}":["npm run prettier","git add"]},"publishConfig":{"access":"public"},"devDependencies":{"@types/jest":"^24.0.13","@types/node":"^12.0.7","husky":"^2.4.0","jest":"^24.8.0","lint-staged":"^8.2.0","prettier":"^1.18.2","size-limit":"^1.3.6","ts-jest":"^24.0.2","tslint":"^5.17.0","tslint-config-prettier":"^1.18.0","tslint-config-standard":"^8.0.1","typescript":"^3.5.1"},"gitHead":"4be58dc2965b1f96a43dee0f352c29b3590a5663","_id":"@servie/events@1.0.0","_nodeVersion":"12.3.1","_npmVersion":"6.9.0","dist":{"integrity":"sha512-sBSO19KzdrJCM3gdx6eIxV8M9Gxfgg6iDQmH5TIAGaUu+X9VDdsINXJOnoiZ1Kx3TrHdH4bt5UVglkjsEGBcvw==","shasum":"8258684b52d418ab7b86533e861186638ecc5dc1","tarball":"http://registry-npm.ywwl.com/@servie/events/download/@servie/events-1.0.0.tgz","fileCount":9,"unpackedSize":20852,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdAIvUCRA9TVsSAnZWagAAE6cP/j2Op6XYR/Co9+I3Drjr\nDp2b01jkjExiigqNqau8fE+elE3Bl7v7ApLt8bXLc9V4wLwRvoF9Z54YhYvB\nds+cRh+keYsBmYZlkdDyfjc7grnRsaz+fCLMnU9TU48pyea6WYkYxC3mgCM3\nN6dXxHozNGFel8IYIjHWUkefDgBdmQzJqbtemZZQEThtpuH4QMWHEDXkuyig\nBAlyl5kNOD6fU44yEfhtrZOJMzMBZ9ZHJdTxj9ZoUQNSkJL93ehvcDU8l9g/\nkOmyJW8vE3bclMfV89uqMlogV4nmV2+NejtO88mpXG+CyyIPn9xwCJkoUCUA\nlMrYHBjYXX4V1ZxnNBP+jQ236yYnRu80NABfduavGDSnkzOVX9qm9hYZ+dmV\n0yNbliVVsc1hsebd++vvJdZS2phM4m15kHZ2CQIa003B+PEwCwEd0+6y6kYt\nggmRanZB//rebsEFsSu2xnWWILGXCZOixPesTfBEUgMUY51JtkfsT0d0+7PY\nhd2cUrB0d802FZvnGB1d6DVu1b6hxZ1wSBRTREm0Mn9txTXb9ZEyg8xI0N8G\n6GoikW7PP3haV2iniCEudoxIQMiwgfaM40uiO9aLY+YcrJP9720Sz1GMk5MY\noLk1HBGm3HRPkm1ghD2Xnfstw1/3jw6bD5vuKxQAJyjisVbi/DXYXz0urlvj\n1RVK\r\n=1Ddi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCQCsyY/h73PlTLTyHTwHVPAuGiNtnDr71750fyPwBv2gIhAPmdmXhgNkmD6RWfbDaJM/pdaeC5mA/Izb0+jW3wo/4g"}],"size":5179,"noattachment":false,"key":"/@servie/events/-/@servie/events-1.0.0.tgz"},"maintainers":[{"name":"blakeembrey","email":"hello@blakeembrey.com"}],"_npmUser":{"name":"blakeembrey","email":"hello@blakeembrey.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/events_1.0.0_1560316883520_0.028145683388050013"},"_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":1560316883722,"_cnpm_publish_time":1560316883722,"dist-tags":{"latest":"3.0.0"}}