{"name":"@metamask/safe-event-emitter","version":"3.1.2","description":"An EventEmitter that isolates the emitter from errors in handlers","main":"dist/cjs/index.js","module":"dist/esm/index.mjs","types":"dist/cjs/index.d.ts","exports":{".":{"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.mjs"},"require":{"types":"./dist/cjs/index.d.ts","default":"./dist/cjs/index.js"}},"./package.json":"./package.json"},"publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"},"repository":{"type":"git","url":"git+https://github.com/MetaMask/safe-event-emitter.git"},"engines":{"node":">=12.0.0"},"scripts":{"prepublishOnly":"yarn build","build":"rimraf dist && yarn build:cjs && yarn build:esm","build:cjs":"tsc --project .","build:esm":"tsc --project tsconfig.esm.json && yarn build:esm:rename","build:esm:rename":"./scripts/rename-esm.sh","test":"jest","lint":"eslint . --ext .ts,.js"},"author":"","license":"ISC","devDependencies":{"@metamask/auto-changelog":"^2.6.1","@metamask/eslint-config":"^5.0.0","@types/jest":"^26.0.20","@types/node":"^14.14.21","@typescript-eslint/eslint-plugin":"^4.33.0","@typescript-eslint/parser":"^4.33.0","eslint":"^7.32.0","eslint-plugin-import":"^2.22.1","eslint-plugin-jest":"^24.1.3","eslint-plugin-node":"^11.1.0","jest":"^26.4.2","rimraf":"^3.0.2","ts-jest":"^26.4.0","typescript":"^4.0.5"},"dependencies":{},"gitHead":"5accae2298447d05a35216fcb1fa38e06fa7b422","bugs":{"url":"https://github.com/MetaMask/safe-event-emitter/issues"},"homepage":"https://github.com/MetaMask/safe-event-emitter#readme","_id":"@metamask/safe-event-emitter@3.1.2","_nodeVersion":"16.20.2","_npmVersion":"8.19.4","dist":{"integrity":"sha512-5yb2gMI1BDm0JybZezeoX/3XhPDOtTbcFvpTXM9kxsoZjPZFh4XciqRbpD6N86HYZqWDhEaKUDuOyR0sQHEjMA==","shasum":"bfac8c7a1a149b5bbfe98f59fbfea512dfa3bad4","tarball":"http://registry-npm.ywwl.com/@metamask/safe-event-emitter/download/@metamask/safe-event-emitter-3.1.2.tgz","fileCount":15,"unpackedSize":23140,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICA12jmTJA/eHv9vtUMdKNCIidBcTe8cSaWsPn1AZnaQAiB03nlFuo3kMfTTN4+HONmRvAGtkJ+hORhu58FoJc//lg=="}],"size":4680,"noattachment":false,"key":"/@metamask/safe-event-emitter/-/@metamask/safe-event-emitter-3.1.2.tgz"},"_npmUser":{"name":"lgbot","email":"khebkoh9@anonaddy.me"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/safe-event-emitter_3.1.2_1729249263297_0.06752863174765644"},"_hasShrinkwrap":false,"readme":"# safe-event-emitter\n\nAn `EventEmitter` that isolates the emitter from errors in handlers. If an error is thrown in a handler it is caught and re-thrown inside of a `setTimeout` so as to not interrupt the emitter's code flow.\n\nThe API is the same as a core [`EventEmitter`](https://nodejs.org/api/events.html).\n\n### Install\n\n```bash\n$ yarn add '@metamask/safe-event-emitter'\n```\n\n### Usage\n\n```js\nimport SafeEventEmitter from '@metamask/safe-event-emitter';\n\nconst ee = new SafeEventEmitter();\nee.on('boom', () => { throw new Error(); });\nee.emit('boom'); // No error here\n\n// Error is thrown after setTimeout\n```\n\n### Release & Publishing\n\nThe project follows the same release process as the other libraries in the MetaMask organization:\n\n1. Create a release branch\n    - For a typical release, this would be based on `master`\n    - To update an older maintained major version, base the release branch on the major version branch (e.g. `1.x`)\n2. Update the changelog\n3. Update version in package.json file (e.g. `yarn version --minor --no-git-tag-version`)\n4. Create a pull request targeting the base branch (e.g. master or 1.x)\n5. Code review and QA\n6. Once approved, the PR is squashed & merged\n7. The commit on the base branch is tagged\n8. The tag can be published as needed\n\n## Running tests\n\n```bash\nyarn test\n```\n","publish_time":1729249263444,"maintainers":[{"name":"mcmire","email":"elliot.winkler@gmail.com"},{"name":"nicholasellul","email":"nicholas.ellul1@gmail.com"},{"name":"lgbot","email":"khebkoh9@anonaddy.me"},{"name":"naugtur","email":"naugtur@gmail.com"},{"name":"ritave","email":"olaf@tomalka.me"},{"name":"danfinlay","email":"dan@danfinlay.com"},{"name":"kumavis","email":"aaron@kumavis.me"},{"name":"rekmarks","email":"rekmarks@protonmail.com"},{"name":"metamaskbot","email":"metamask-npm@consensys.net"},{"name":"gudahtt","email":"markjstacey@gmail.com"},{"name":"sethkfman","email":"sethkfman@gmail.com"}],"_cnpm_publish_time":1729249263444,"dist-tags":{"latest":"3.1.3"}}