{"bugs":{"url":"https://github.com/developit/mitt/issues"},"dist":{"shasum":"233674e78d1e69c8122d001ad73c985bd3d2599b","tarball":"https://registry.npmjs.org/mitt/-/mitt-2.0.0.tgz","fileCount":12,"integrity":"sha512-MxK9wErRoeNSklOfRT0vYLGQ2edgiG/fooAsbzP2AbS3WiNGDq0XvcaoIQ9ixKGDtowvVtqgCC8h7Y2hAbMzHw==","signatures":[{"sig":"MEYCIQCb3ehCbVtquQws/AwcahDEMads6dTuxRAckk5huRUAaQIhAId4nG7DgTRgjbfBqFPOSh0E2ZSVwrjBQyLzXfrgDS/L","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25576,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJezY/WCRA9TVsSAnZWagAAfakQAIRCaLND1cMhQ25AqNj3\nRPaAWb6j5HlEZobuuLbIOLUFb9mY4yDXMelKDG2TM+d91SWBfsJtV+96ACQ/\nxrjWp974EuihTjcpIjVRrIJKRHLcrhQ8+wDg0g4lYy0BuF3rfKEiH0iWXaAB\ndqDvO/pefkzlkWJF5aVOnYcRJqEyFEiomj2goAt9i9PC0X2WUEFKH8rYw4kR\nbw4XOVZ8fRO8oPy4jsjsByZ5YaNLYfwTu0geKWYdGvtdJL+WLyOS6zqKG0qw\nvIpMt1sKgu2J7p6yCsQg7cRz1anVyAhX8TggNayKOi1ARSJ70h8Zng2PBfT5\nK9w3PtlgBw299o6fBGsve9fkyTh6CwAiOnw4da/mLVoKNOqxPS+x/LgtOkSm\nT3wIwCJrPTWTPMe6i2XtJK2ebKqxYZ6eI8CX9tlNKVKGwBFsew9XaLmMyDub\nlrGtks/nKjewca+HT4f5HB1NTxBxz4dSprnWeyugeblnWHuJMDqjhhnLXl02\nKGb1HIbNfmpZtErWY9bKnopFgUeqoYMWu5QE5pc7Q/hYPPzNeIiJA/I/OxmA\nRXEIJEU9x8eEJ6A5AZW8YS/AjHNjyrt3DTdQSAW8Ulb0YJZUqIpPiFv95LRv\nRYM0eCNpUg0GXFh3r01JXzFOg0hVEUKLOIb6wNULbuI4vpkkJcM7+OZ1csTl\num0C\r\n=tJot\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?style=flat\" alt=\"npm\"></a> <a href=\"https://travis-ci.org/developit/mitt\"><img src=\"https://travis-ci.org/developit/mitt.svg?branch=master\" alt=\"travis\"></a> <a href=\"https://david-dm.org/developit/mitt\"><img src=\"https://david-dm.org/developit/mitt/status.svg\" alt=\"dependencies Status\"></a> <a href=\"https://unpkg.com/mitt/dist/mitt.umd.js\"><img src=\"http://img.badgesize.io/https://unpkg.com/mitt/dist/mitt.js?compression=gzip\" alt=\"gzip size\"></a>\n  \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":"0ead0bafdee03a0da3ea552d847b712b7825d562","license":"MIT","scripts":{"docs":"documentation readme src/index.ts --section API -q --parse-extension ts","lint":"eslint src test --ext ts --ext js","test":"tsc src/index.ts --noEmit && npm run lint && npm run 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 tag $npm_package_version && git push && git push --tags && npm publish","testonly":"mocha --require esm --require ts-node/register test/**/*.js"},"typings":"dist/index.d.ts","_npmUser":{"name":"developit","email":"jason@developit.ca"},"homepage":"https://github.com/developit/mitt","keywords":["events","eventemitter","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,"mocha":true,"browser":true},"rules":{"semi":[2,"always"],"@typescript-eslint/no-explicit-any":0,"@typescript-eslint/no-empty-function":0,"@typescript-eslint/explicit-function-return-type":0},"parser":"@typescript-eslint/parser","extends":["eslint:recommended","plugin:@typescript-eslint/eslint-recommended","plugin:@typescript-eslint/recommended"],"globals":{"expect":true},"parserOptions":{"sourceType":"module"}},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"esm":"^3.2.25","chai":"^3.5.0","mocha":"^3.2.0","sinon":"^1.17.4","eslint":"^6.5.1","rimraf":"^2.5.2","ts-node":"^8.10.1","sinon-chai":"^2.8.0","typescript":"^3.9.3","microbundle":"^0.12.0","npm-run-all":"^2.1.1","documentation":"^13.0.0","@typescript-eslint/parser":"^2.34.0","@typescript-eslint/eslint-plugin":"^2.34.0"},"_npmOperationalInternal":{"tmp":"tmp/mitt_2.0.0_1590530005799_0.15743291739677634","host":"s3://npm-registry-packages"},"_id":"mitt@2.0.0","version":"2.0.0"}