{"name":"@metamask/safe-event-emitter","version":"3.1.1","author":"","license":"ISC","_id":"@metamask/safe-event-emitter@3.1.1","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":"security@metamask.io"},{"name":"gudahtt","email":"markjstacey@gmail.com"},{"name":"brad.decker","email":"bhdecker84@gmail.com"},{"name":"sethkfman","email":"sethkfman@gmail.com"}],"homepage":"https://github.com/MetaMask/safe-event-emitter#readme","bugs":{"url":"https://github.com/MetaMask/safe-event-emitter/issues"},"dist":{"shasum":"e89b840a7af8097a8ed4953d8dc8470d1302d3ef","tarball":"http://registry-npm.ywwl.com/@metamask/safe-event-emitter/download/@metamask/safe-event-emitter-3.1.1.tgz","fileCount":16,"integrity":"sha512-ihb3B0T/wJm1eUuArYP4lCTSEoZsClHhuWyfo/kMX3m/odpqNcPfsz5O2A3NT7dXCAgWPGDQGPqygCpgeniKMw==","signatures":[{"sig":"MEYCIQCxPqz5u0vJr2lvHWVXV4joZOcX3w8aGyUfMxcYHAiU6gIhAMVm/0g2yF5NcCKrDvvyLAwsrDrVvBNzgNO/3qPcn1z6","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24148,"size":5125,"noattachment":false,"key":"/@metamask/safe-event-emitter/-/@metamask/safe-event-emitter-3.1.1.tgz"},"main":"dist/cjs/index.js","types":"dist/cjs/index.d.ts","module":"dist/esm/index.mjs","engines":{"node":">=12.0.0"},"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"},"gitHead":"56ac561708e805407ddf08d61046a2c2fb5bf6bd","scripts":{"lint":"eslint . --ext .ts,.js","test":"jest","build":"rimraf dist && yarn build:cjs && yarn build:esm","build:cjs":"tsc --project .","build:esm":"tsc --project tsconfig.esm.json && yarn build:esm:rename","prepublishOnly":"yarn build","build:esm:rename":"./scripts/rename-esm.sh"},"_npmUser":{"name":"lgbot","email":"khebkoh9@anonaddy.me"},"repository":{"url":"git+https://github.com/MetaMask/safe-event-emitter.git","type":"git"},"_npmVersion":"6.14.16","description":"An EventEmitter that isolates the emitter from errors in handlers","directories":{},"_nodeVersion":"12.22.12","dependencies":{},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.4.2","eslint":"^7.32.0","rimraf":"^3.0.2","ts-jest":"^26.4.0","typescript":"^4.0.5","@types/jest":"^26.0.20","@types/node":"^14.14.21","eslint-plugin-jest":"^24.1.3","eslint-plugin-node":"^11.1.0","eslint-plugin-import":"^2.22.1","@metamask/eslint-config":"^5.0.0","@typescript-eslint/parser":"^4.33.0","@typescript-eslint/eslint-plugin":"^4.33.0"},"_npmOperationalInternal":{"tmp":"tmp/safe-event-emitter_3.1.1_1710241997514_0.577222398693628","host":"s3://npm-registry-packages"},"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":1710241997653,"_cnpm_publish_time":1710241997653,"dist-tags":{"latest":"3.1.3"}}