{"bugs":{"url":"https://github.com/developit/mitt/issues"},"dist":{"shasum":"9e8a075b4daae82dd91aac155a0ece40ca7cb393","tarball":"https://registry.npmjs.org/mitt/-/mitt-2.0.1.tgz","fileCount":12,"integrity":"sha512-FhuJY+tYHLnPcBHQhbUFzscD5512HumCPE4URXZUgPi3IvOJi4Xva5IIgy3xX56GqCmw++MAm5UURG6kDBYTdg==","signatures":[{"sig":"MEQCID+tmCV5TlMcb4yiH4VLoY6JC0Bn0LJ5k8qvQQQwOR1gAiBx5WrxVRV5JxrMicmsNjOdVGwdE3bJCVS1zaGtoDqCmA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26260,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJezqbyCRA9TVsSAnZWagAAy1UP/0/N+YKPT3xPvaqSS4NI\nyjw20spx2r9lXHSDMoJG/Ovq/LSHtXg8HlGDTdTLGyPhoteTsKIj5CK53Tb/\nxQWp8y453UyvqHu3LYYELV+cIoM2sO3Anw6C765qWtkbeVKYsOAT7uA7qkl5\nEHw2gtlBSuZ46PquLn63DwL+HuwJRfh1oaGz0RomWQs1WwH5Bu/JMjBqQtKF\ncVEInduXWFRIruKJsE4r+97k/3ApUZAh1Y/MxTjupPlnPVyNRMOO5hlsMKLb\nN3dzqFsgDUPMs2dy0eXf/2NAv7+2/RoPnnDzyDn2UF8FVhYzuD2U9oI5NCqA\n3V5fpglu12zgpLLetym2qI3/vgTiG8QA0ugVrKlFql1AfgtXm0k26yQc5sDj\nIipyPudAU3Vu97jmgptL7Oby8HclBxUK9S8Fzaj7Tw+gFyfYb14EhdNWSL7v\n3oxGHR0KTItxOD4nTymlEnSLZSmZ42M/wPTTnOIhcpZd9ugLXb6bilIUa3bS\nt2sMcF3cFt/r3Jcu4VOq0PIfzvwh1lMuLcdCFNobscMxXG1ByIcbBsqZCOWs\noiazwLenOcfO6rjNuAEhZa+vPCxWKJPgsZU0UjseE4sTQJgCDhlYHIYNE4v8\nq+f4+KVlovck3Daqr1rApLQxFDeA7VTV/U3hledQu9QzijmmK/DJlp47TTXl\nd6aO\r\n=Xkqc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mitt.js","name":"mitt","module":"dist/mitt.es.js","readme":"<p align=\"center\">\n  <img src=\"https://i.imgur.com/BqsX9NT.png\" width=\"300\" height=\"300\" alt=\"mitt\">\n  <br>\n  <a href=\"https://www.npmjs.org/package/mitt\"><img src=\"https://img.shields.io/npm/v/mitt.svg\" alt=\"npm\"></a>\n  <img src=\"https://github.com/developit/mitt/workflows/CI/badge.svg\" alt=\"build status\">\n  <a href=\"https://unpkg.com/mitt/dist/mitt.js\"><img src=\"https://img.badgesize.io/https://unpkg.com/mitt/dist/mitt.js?compression=gzip\" alt=\"gzip size\"></a>\n</p>\n\n# Mitt\n\n> Tiny 200b functional event emitter / pubsub.\n\n-   **Microscopic:** weighs less than 200 bytes gzipped\n-   **Useful:** a wildcard `\"*\"` event type listens to all events\n-   **Familiar:** same names & ideas as [Node's EventEmitter](https://nodejs.org/api/events.html#events_class_eventemitter)\n-   **Functional:** methods don't rely on `this`\n-   **Great Name:** somehow [mitt](https://npm.im/mitt) wasn't taken\n\nMitt was made for the browser, but works in any JavaScript runtime. It has no dependencies and supports IE9+.\n\n## Table of Contents\n\n-   [Install](#install)\n-   [Usage](#usage)\n-   [Examples & Demos](#examples--demos)\n-   [API](#api)\n-   [Contribute](#contribute)\n-   [License](#license)\n\n## Install\n\nThis project uses [node](http://nodejs.org) and [npm](https://npmjs.com). Go check them out if you don't have them locally installed.\n\n```sh\n$ npm install --save mitt\n```\n\nThen with a module bundler like [rollup](http://rollupjs.org/) or [webpack](https://webpack.js.org/), use as you would anything else:\n\n```javascript\n// using ES6 modules\nimport mitt from 'mitt'\n\n// using CommonJS modules\nvar mitt = require('mitt')\n```\n\nThe [UMD](https://github.com/umdjs/umd) build is also available on [unpkg](https://unpkg.com):\n\n```html\n<script src=\"https://unpkg.com/mitt/dist/mitt.umd.js\"></script>\n```\n\nYou can find the library on `window.mitt`.\n\n## Usage\n\n```js\nimport mitt from 'mitt'\n\nconst emitter = mitt()\n\n// listen to an event\nemitter.on('foo', e => console.log('foo', e) )\n\n// listen to all events\nemitter.on('*', (type, e) => console.log(type, e) )\n\n// fire an event\nemitter.emit('foo', { a: 'b' })\n\n// working with handler references:\nfunction onFoo() {}\nemitter.on('foo', onFoo)   // listen\nemitter.off('foo', onFoo)  // unlisten\n```\n\n### Typescript\n\n```ts\nimport mitt from 'mitt';\nconst emitter: mitt.Emitter = mitt();\n```\n\n## Examples & Demos\n\n<a href=\"http://codepen.io/developit/pen/rjMEwW?editors=0110\">\n  <b>Preact + Mitt Codepen Demo</b>\n  <br>\n  <img src=\"https://i.imgur.com/CjBgOfJ.png\" width=\"278\" alt=\"preact + mitt preview\">\n</a>\n\n* * *\n\n## API\n\n<!-- Generated by documentation.js. Update this documentation by updating the source code. -->\n\n#### Table of Contents\n\n-   [mitt](#mitt)\n-   [on](#on)\n    -   [Parameters](#parameters)\n-   [off](#off)\n    -   [Parameters](#parameters-1)\n-   [emit](#emit)\n    -   [Parameters](#parameters-2)\n\n### mitt\n\nMitt: Tiny (~200b) functional event emitter / pubsub.\n\nReturns **Mitt** \n\n### on\n\nRegister an event handler for the given type.\n\n#### Parameters\n\n-   `type` **([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) \\| [symbol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol))** Type of event to listen for, or `\"*\"` for all events\n-   `handler` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** Function to call in response to given event\n\n### off\n\nRemove an event handler for the given type.\n\n#### Parameters\n\n-   `type` **([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) \\| [symbol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol))** Type of event to unregister `handler` from, or `\"*\"`\n-   `handler` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** Handler function to remove\n\n### emit\n\nInvoke all handlers for the given type.\nIf present, `\"*\"` handlers are invoked after type-matched handlers.\n\nNote: Manually firing \"\\*\" handlers is not supported.\n\n#### Parameters\n\n-   `type` **([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) \\| [symbol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol))** The event type to invoke\n-   `evt` **Any?** Any value (object is recommended and powerful), passed to each handler\n\n## Contribute\n\nFirst off, thanks for taking the time to contribute!\nNow, take a moment to be sure your contributions make sense to everyone else.\n\n### Reporting Issues\n\nFound a problem? Want a new feature? First of all see if your issue or idea has [already been reported](../../issues).\nIf don't, just open a [new clear and descriptive issue](../../issues/new).\n\n### Submitting pull requests\n\nPull requests are the greatest contributions, so be sure they are focused in scope, and do avoid unrelated commits.\n\n-   Fork it!\n-   Clone your fork: `git clone https://github.com/<your-username>/mitt`\n-   Navigate to the newly cloned directory: `cd mitt`\n-   Create a new branch for the new feature: `git checkout -b my-new-feature`\n-   Install the tools necessary for development: `npm install`\n-   Make your changes.\n-   Commit your changes: `git commit -am 'Add some feature'`\n-   Push to the branch: `git push origin my-new-feature`\n-   Submit a pull request with full remarks documenting your changes.\n\n## License\n\n[MIT License](https://opensource.org/licenses/MIT) © [Jason Miller](https://jasonformat.com/)\n","source":"src/index.ts","authors":["Jason Miller <jason@developit.ca>"],"gitHead":"59591757df1a563274e56ee1f80a54818834afca","license":"MIT","scripts":{"docs":"documentation readme src/index.ts --section API -q --parse-extension ts","lint":"eslint src test --ext ts --ext js","test":"npm-run-all --silent typecheck lint testonly","build":"npm-run-all --silent clean -p bundle -s docs","clean":"rimraf dist","bundle":"microbundle","release":"npm run -s build -s && npm t && git commit -m $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish","testonly":"mocha --require esm test/**/*.js","typecheck":"tsc **/*.ts --noEmit"},"typings":"dist/index.d.ts","_npmUser":{"name":"developit","email":"jason@developit.ca"},"homepage":"https://github.com/developit/mitt","keywords":["events","eventemitter","emitter","pubsub"],"umd:main":"dist/mitt.umd.js","esmodules":"dist/mitt.modern.js","repository":{"url":"git+https://github.com/developit/mitt.git","type":"git"},"_npmVersion":"6.13.4","description":"Tiny 200b functional Event Emitter / pubsub.","directories":{},"jsnext:main":"dist/mitt.es.js","maintainers":[{"name":"developit","email":"jason@developit.ca"}],"_nodeVersion":"12.16.0","eslintConfig":{"env":{"es6":true,"jest":false,"mocha":true,"browser":true},"rules":{"semi":[2,"always"],"jest/valid-expect":0,"@typescript-eslint/no-explicit-any":0,"@typescript-eslint/no-empty-function":0,"@typescript-eslint/explicit-function-return-type":0,"@typescript-eslint/explicit-module-boundary-types":0},"parser":"@typescript-eslint/parser","extends":["developit","plugin:@typescript-eslint/eslint-recommended","plugin:@typescript-eslint/recommended"],"globals":{"expect":true},"parserOptions":{"sourceType":"module"}},"eslintIgnore":["dist"],"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"esm":"^3.2.25","chai":"^4.2.0","mocha":"^7.2.0","sinon":"^9.0.2","eslint":"^7.1.0","rimraf":"^3.0.2","ts-node":"^8.10.1","sinon-chai":"^3.5.0","typescript":"^3.9.3","@types/chai":"^4.2.11","microbundle":"^0.12.0","npm-run-all":"^4.1.5","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","documentation":"^13.0.0","@types/sinon-chai":"^3.2.4","eslint-config-developit":"^1.2.0","@typescript-eslint/parser":"^3.0.1","@typescript-eslint/eslint-plugin":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/mitt_2.0.1_1590601458172_0.028297092586270445","host":"s3://npm-registry-packages"},"_id":"mitt@2.0.1","version":"2.0.1"}