{"_id":"@antan/eventemitter","_rev":"1-2618b98d4afe418748f38c764687c166","name":"@antan/eventemitter","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@antan/eventemitter","version":"1.0.0","description":"一个简单的 EventEmitter","main":"lib/index.js","scripts":{"build":"rollup --config rollup.config.js","prepublishOnly":"rm -rf lib && npm run build"},"repository":{"type":"git","url":"git+https://github.com/banzheshenghuo/EventEmitter.git"},"keywords":["EventEmitter"],"author":{"name":"banzheshenghuo"},"license":"MIT","bugs":{"url":"https://github.com/banzheshenghuo/EventEmitter/issues"},"homepage":"https://github.com/banzheshenghuo/EventEmitter#readme","devDependencies":{"@babel/core":"^7.13.13","@babel/preset-env":"^7.13.12","babel-eslint":"^10.1.0","babel-plugin-transform-class-properties":"^6.24.1","eslint":"^7.23.0","eslint-config-prettier":"^8.1.0","rollup":"^2.43.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-eslint":"^7.0.0","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-terser":"^7.0.2"},"gitHead":"2e2196432453770d92b05b839961bd6bc1c10a1e","_id":"@antan/eventemitter@1.0.0","_nodeVersion":"10.9.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-aZg8TxiwQe1VSiX3rw7lNzeHVta+Rt+8YoNUHrbf573T/0d4FeTkfH6kmBZVzc3zvYISlVWkcwQ6AHvCeVTaqg==","shasum":"f80bd151e9b23221245da2c2a03ea16d858908c7","tarball":"https://registry.npmjs.org/@antan/eventemitter/-/eventemitter-1.0.0.tgz","fileCount":9,"unpackedSize":8436,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgYvYtCRA9TVsSAnZWagAAfb8P/iIcTX+Zt0T7XnmpHAJh\nTf1zMoKz8iJU3bOnSN3rjgTV5TNjHlK5X6Cwj1l/EtaUmc+eVW05fGFBt/Bs\navCClmtU30b2cjU2o+mhgbOlBLJ6c55yClBM5vxmcDJXDJFWh47VJ1+RDIwI\n+8FK3ZJstbD0+72qbMbaa8q8ndUqnL56u6WI/G8v8AGbhVTCLTSVuMgTfoNn\n1x3oxE1ee9S2SDF9Le+n5KWdiS8ZIp33k5Y4689e3aUuhmL4TjkymFSc5Gdw\nE/VyiXhDfHPFgr68tmc9UKsBHV9mI79YC69QbrnQJHhftyIvA+mVkMOR/m9V\nbR66m74LGOrGudL1SKGHd4sV2zKHSvcEvUV2NZtMq8Vgn8iemPaZxrZrAM6t\ndqTW7lef8ggmot6btwUhdBNV3VwTxl03dVasKonWUiGo8yKNoEVTcahxKHj9\nQFI3EWXmbx3tKVTt8m41Sc6EVcS5MoX8NyhOMaWqvFytKBVnWZlUMTCAxyov\nbtz9ury9Nm4pewQS+K4Wcu5wEi2vdcEM2hOrBe6M9Zni2acPHB960lomMBW4\nEtvri/4TGN+s6RoqXttbmPptMCVt3X/LtUElknSp2hutGZ0Z8hC2SsHy6ASr\nATjTTcq/h5o3jCvurvs+FE19/dEpU8k0D34CqAK+T7LLRqM3umudJOJt75ED\nrWM4\r\n=7FK8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICMUWsNfNxwf2TiG5bojQN8Pq/QXj3U5awJku2TUjPH8AiBV1u428C7LyBmaxGCuAW1FjzT72lOfA62eeD5Qsw5Oqw=="}]},"_npmUser":{"name":"banzheshenghuo","email":"2271362435@qq.com"},"directories":{},"maintainers":[{"name":"banzheshenghuo","email":"2271362435@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/eventemitter_1.0.0_1617098285158_0.4079127163984797"},"_hasShrinkwrap":false}},"time":{"created":"2021-03-30T09:58:04.911Z","1.0.0":"2021-03-30T09:58:05.267Z","modified":"2022-04-04T14:20:46.794Z"},"maintainers":[{"name":"banzheshenghuo","email":"2271362435@qq.com"}],"description":"一个简单的 EventEmitter","homepage":"https://github.com/banzheshenghuo/EventEmitter#readme","keywords":["EventEmitter"],"repository":{"type":"git","url":"git+https://github.com/banzheshenghuo/EventEmitter.git"},"author":{"name":"banzheshenghuo"},"bugs":{"url":"https://github.com/banzheshenghuo/EventEmitter/issues"},"license":"MIT","readme":"<h1 align=\"center\">Welcome to EventEmitter 👋</h1>\n<p>\n  <a href=\"https://www.npmjs.com/package/eventemitter\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/eventemitter.svg\">\n  </a>\n  <a href=\"https://github.com/banzheshenghuo/EventEmitter#readme\" target=\"_blank\">\n    <img alt=\"Documentation\" src=\"https://img.shields.io/badge/documentation-yes-brightgreen.svg\" />\n  </a>\n  <a href=\"https://github.com/banzheshenghuo/EventEmitter/graphs/commit-activity\" target=\"_blank\">\n    <img alt=\"Maintenance\" src=\"https://img.shields.io/badge/Maintained%3F-yes-green.svg\" />\n  </a>\n</p>\n\n> 一个简单的 EventEmitter\n\n### 🏠 [首页](https://github.com/banzheshenghuo/EventEmitter#readme)\n\n## 安装\n\n```sh\nnpm install\n```\n\n## API\n\n```js\nconst emitter = new EventEmitter(isStrict: boolean);\n```\n\nisStrict 默认为false，用于on和off方法中判断是否相同监听器。\n\n- false 按照引用判断是否相同\n- true 调用toString后根据生成的字符串判断是否相同\n\n### on\n\n添加事件监听器\n\n```js\nemitter.on(eventName: string | Symbol, listener: Function)\n```\n\n### emit\n\n触发事件\n\n```js\nemitter.emit(eventName: string | Symbol, data: any)\n```\n\n### off\n\n删除事件监听器\n\n```js\nemitter.off(eventName: string | Symbol, listener: Function)\n```\n\n### allOff\n\n删除指定时间类型的所有事件监听器\n\n```js\nemitter.allOff(eventName: string | Symbol)\n```\n\n## Author\n\n👤 **banzheshenghuo**\n\n* Github: [@banzheshenghuo](https://github.com/banzheshenghuo)\n\n## Show your support\n\nGive a ⭐️ if this project helped you!\n\n***\n_This README was generated with ❤️ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_","readmeFilename":"README.md"}