{"_id":"@metamask/safe-event-emitter","_rev":"4642465","name":"@metamask/safe-event-emitter","description":"An EventEmitter that isolates the emitter from errors in handlers","dist-tags":{"latest":"3.1.2"},"maintainers":[{"name":"danfinlay","email":"dan@danfinlay.com"},{"name":"gudahtt","email":"markjstacey@gmail.com"},{"name":"kumavis","email":"aaron@kumavis.me"},{"name":"metamaskbot","email":""}],"time":{"modified":"2026-04-10T20:03:45.000Z","created":"2020-09-22T14:18:32.089Z","3.1.2":"2024-10-18T11:01:03.444Z","3.1.1":"2024-03-12T11:13:17.653Z","3.1.0":"2024-03-08T19:38:30.244Z","3.0.0":"2023-04-24T14:25:45.208Z","2.0.0":"2020-09-22T14:18:32.089Z"},"users":{},"author":"","repository":{"type":"git","url":"git+https://github.com/MetaMask/safe-event-emitter.git"},"versions":{"3.1.2":{"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":{"shasum":"bfac8c7a1a149b5bbfe98f59fbfea512dfa3bad4","size":4680,"noattachment":false,"key":"/@metamask/safe-event-emitter/-/@metamask/safe-event-emitter-3.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/@metamask/safe-event-emitter/download/@metamask/safe-event-emitter-3.1.2.tgz"},"_npmUser":{"name":"lgbot","email":"khebkoh9@anonaddy.me"},"directories":{},"maintainers":[{"name":"danfinlay","email":"dan@danfinlay.com"},{"name":"gudahtt","email":"markjstacey@gmail.com"},{"name":"kumavis","email":"aaron@kumavis.me"},{"name":"metamaskbot","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/safe-event-emitter_3.1.2_1729249263297_0.06752863174765644"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-10-18T11:01:03.444Z","publish_time":1729249263444,"_source_registry_name":"default","_cnpm_publish_time":1729249263444},"3.1.1":{"name":"@metamask/safe-event-emitter","version":"3.1.1","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/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":"56ac561708e805407ddf08d61046a2c2fb5bf6bd","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.1","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"shasum":"e89b840a7af8097a8ed4953d8dc8470d1302d3ef","size":5125,"noattachment":false,"key":"/@metamask/safe-event-emitter/-/@metamask/safe-event-emitter-3.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/@metamask/safe-event-emitter/download/@metamask/safe-event-emitter-3.1.1.tgz"},"_npmUser":{"name":"lgbot","email":"khebkoh9@anonaddy.me"},"directories":{},"maintainers":[{"name":"danfinlay","email":"dan@danfinlay.com"},{"name":"gudahtt","email":"markjstacey@gmail.com"},{"name":"kumavis","email":"aaron@kumavis.me"},{"name":"metamaskbot","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/safe-event-emitter_3.1.1_1710241997514_0.577222398693628"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-03-12T11:13:17.653Z","publish_time":1710241997653,"_source_registry_name":"default","_cnpm_publish_time":1710241997653},"3.1.0":{"name":"@metamask/safe-event-emitter","version":"3.1.0","description":"An EventEmitter that isolates the emitter from errors in handlers","main":"dist/cjs/index.js","module":"dist/esm/index.js","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":"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/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","ts-jest":"^26.4.0","typescript":"^4.0.5"},"dependencies":{},"_id":"@metamask/safe-event-emitter@3.1.0","gitHead":"a68ac06ae51efff84dbc745783d38746b5bdc166","bugs":{"url":"https://github.com/MetaMask/safe-event-emitter/issues"},"homepage":"https://github.com/MetaMask/safe-event-emitter#readme","_nodeVersion":"20.11.0","_npmVersion":"10.2.4","dist":{"shasum":"84a7d3233a38b00dff5c3c13b9594c1bf2020b43","size":4662,"noattachment":false,"key":"/@metamask/safe-event-emitter/-/@metamask/safe-event-emitter-3.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@metamask/safe-event-emitter/download/@metamask/safe-event-emitter-3.1.0.tgz"},"_npmUser":{"name":"gudahtt","email":"markjstacey@gmail.com"},"directories":{},"maintainers":[{"name":"danfinlay","email":"dan@danfinlay.com"},{"name":"gudahtt","email":"markjstacey@gmail.com"},{"name":"kumavis","email":"aaron@kumavis.me"},{"name":"metamaskbot","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/safe-event-emitter_3.1.0_1709926710061_0.702563681437578"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-03-08T19:38:30.244Z","publish_time":1709926710244,"_source_registry_name":"default","_cnpm_publish_time":1709926710244},"3.0.0":{"name":"@metamask/safe-event-emitter","version":"3.0.0","description":"An EventEmitter that isolates the emitter from errors in handlers","main":"index.js","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":"tsc --project .","test":"jest","lint":"eslint . --ext .ts,.js"},"author":"","license":"ISC","devDependencies":{"@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","ts-jest":"^26.4.0","typescript":"^4.0.5"},"dependencies":{},"gitHead":"ad99d386c05654fa47f1628a9e0fa1a1e3c2fee8","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.0.0","_nodeVersion":"12.22.3","_npmVersion":"6.14.13","dist":{"shasum":"8c2b9073fe0722d48693143b0dc8448840daa3bd","size":3599,"noattachment":false,"key":"/@metamask/safe-event-emitter/-/@metamask/safe-event-emitter-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@metamask/safe-event-emitter/download/@metamask/safe-event-emitter-3.0.0.tgz"},"_npmUser":{"name":"gudahtt","email":"markjstacey@gmail.com"},"directories":{},"maintainers":[{"name":"danfinlay","email":"dan@danfinlay.com"},{"name":"gudahtt","email":"markjstacey@gmail.com"},{"name":"kumavis","email":"aaron@kumavis.me"},{"name":"metamaskbot","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/safe-event-emitter_3.0.0_1682346345089_0.9080205485779469"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-04-24T14:25:45.208Z","publish_time":1682346345208,"_cnpm_publish_time":1682346345208},"2.0.0":{"name":"@metamask/safe-event-emitter","version":"2.0.0","description":"An EventEmitter that isolates the emitter from errors in handlers","main":"index.js","publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"},"scripts":{"prepublishOnly":"yarn build","build":"tsc --project .","test":"jest","lint":"eslint . --ext .ts,.js"},"author":{},"license":"ISC","devDependencies":{"@metamask/eslint-config":"^3.1.0","@types/jest":"^24.9.0","@types/node":"^10.17.13","@typescript-eslint/eslint-plugin":"^2.20.0","@typescript-eslint/parser":"^2.16.0","eslint":"^6.8.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.6.0","jest":"^24.9.0","ts-jest":"^24.3.0","typescript":"^3.9.2"},"dependencies":{},"licenseText":"ISC License\n\nCopyright (c) 2020 MetaMask\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted, provided that the above\ncopyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\nWITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\nMERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\nANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\nWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\nACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\nOR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n","_id":"@metamask/safe-event-emitter@2.0.0","dist":{"shasum":"af577b477c683fad17c619a78208cede06f9605c","size":3499,"noattachment":false,"key":"/@metamask/safe-event-emitter/-/@metamask/safe-event-emitter-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@metamask/safe-event-emitter/download/@metamask/safe-event-emitter-2.0.0.tgz"},"maintainers":[{"name":"danfinlay","email":"dan@danfinlay.com"},{"name":"gudahtt","email":"markjstacey@gmail.com"},{"name":"kumavis","email":"aaron@kumavis.me"},{"name":"metamaskbot","email":""}],"_npmUser":{"name":"whymarrh","email":"whymarrh.whitby@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/safe-event-emitter_2.0.0_1600784311986_0.8692289238092814"},"_hasShrinkwrap":false,"publish_time":1600784312089,"_cnpm_publish_time":1600784312089,"_cnpmcore_publish_time":"2021-12-16T17:14:50.217Z"}},"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","_attachments":{},"homepage":"https://github.com/MetaMask/safe-event-emitter#readme","bugs":{"url":"https://github.com/MetaMask/safe-event-emitter/issues"},"license":"ISC"}