{"_id":"@cadienvan/event-emitter","_rev":"3-7fa9e2962160ed982366a4161d346308","name":"@cadienvan/event-emitter","dist-tags":{"latest":"0.1.2"},"versions":{"0.0.1":{"name":"@cadienvan/event-emitter","private":false,"version":"0.0.1","main":"dist/index.js","module":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.js"},"./package.json":"./package.json"},"scripts":{"ts-types":" tsc --emitDeclarationOnly --outDir dist","build":"npm run lint && rimraf dist && NODE_ENV=production node esbuild.js && npm run ts-types","demo-test":"for file in demo/*.js; do node $file; done","prettier":"prettier --write .","lint":"eslint . --ext .ts","prepare":"husky install","dev":"jest --watch","test":"jest --no-cache"},"prepare":"npm run build","devDependencies":{"@types/jest":"^29.2.0","@types/node":"^18.11.7","@typescript-eslint/eslint-plugin":"^5.41.0","@typescript-eslint/parser":"^5.41.0","esbuild":"^0.15.12","eslint":"^8.26.0","husky":"^8.0.1","jest":"^29.2.2","lint-staged":"^13.0.3","prettier":"^2.7.1","rimraf":"^3.0.2","ts-jest":"^29.0.3","typescript":"^4.8.4"},"lint-staged":{"**/*.{js,jsx,ts,tsx}":["npx prettier --write","npx eslint --fix"]},"repository":{"type":"git","url":"git://github.com/Cadienvan/event-emitter.git"},"license":"MIT","author":{"name":"Michael Di Prisco","email":"cadienvan@gmail.com"},"gitHead":"e88fbe1e3ee89e7293b95e3c817d4474fd0884c1","description":"This is a function which returns a simple EventEmitter.   It is a simpler implementation of the EventEmitter class from NodeJS.   It is not meant to be a replacement for the NodeJS EventEmitter, but rather a simple alternative for those who don't want to ","bugs":{"url":"https://github.com/Cadienvan/event-emitter/issues"},"homepage":"https://github.com/Cadienvan/event-emitter#readme","_id":"@cadienvan/event-emitter@0.0.1","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-i24SlzocoLF1Qlh/ZzQ+/01r5pZy4n7eU7sTbzzQ5xNKIFH7/Ix1A3CM1Q4v/etISM0camobCSEC3MQIs6Y6Jg==","shasum":"0d3e40076f2f4ae2a265a6cba1a109aa8fbb3079","tarball":"https://registry.npmjs.org/@cadienvan/event-emitter/-/event-emitter-0.0.1.tgz","fileCount":5,"unpackedSize":5660,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDl9vnS+4ZzyBZLJDrh5GrpmMhrTK3jG1Kv+rgLlGYJEgIgfkeSf2ZT9quSDUit4pQ0n0Ylb1oxLZrH7NAGl4bJBwU="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjlGLkACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqWRBAAm2RCkXjDLDaqG5pOmqLZI8M3omJ4mwfYjLcoIw+FsACWvTCN\r\nlY5u061f6qg6gfHyWyBp02skeBGrl7P+qdST5bSYIhUP+kJGJh67t0F19gw3\r\n7rKaEWnvFNmdHQMsAIrvxYrgvTNg+Qw7waJGhBQylhTLd3KwcsiGIlvD0msC\r\nqEg9X+TcZVZAZ8DCN7e71e38ppn1LbcE7xCR/1CDQPH8E0uJjuXoyZ04xBai\r\nrK+2Mm45cqwcgLmlvSvfVyvwiL36ug0ez3qxMEFYZfEqb3UDIQeNcqkHxxGA\r\n90YV5IhpvSIap3xcLiOKFbuB/B0C/xevfn2o59khtSzRmaT2jw50TEF5ul6G\r\nBo6aOcRtyLqShGaSAlwQNYnRIoQsSvhoNIinpOvtcwW2bpHrcwcERwLgNr/N\r\nnOnByTWX4L74Qw9ydUvQ9W/CIMbdPwaIjG/ujsH+VEuePDHOgEvzYr1ggX48\r\nqfdJF2xwz/7eCawOHBRhGGovc2hvDfQAmaSlU787QMlTxmS05ChiPokM4EuW\r\nnsbpGja25SxIsS1tDP+dJw8o10K4HbnM+crCE8Sww97T2GCpR9HUuZtjmSpH\r\nPWDce6yPq42vkaozVGLofu0RTLyiaizqc8M84utdWWxIfKPNOe5hpDlNAFCz\r\nBgXWI3qMu2u8MEpMnlPYmrfWMtp4j5kt8nA=\r\n=5GQg\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"cadienvan","email":"cadienvan@gmail.com"},"directories":{},"maintainers":[{"name":"cadienvan","email":"cadienvan@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/event-emitter_0.0.1_1670669028183_0.04280902881805537"},"_hasShrinkwrap":false},"0.1.0":{"name":"@cadienvan/event-emitter","private":false,"version":"0.1.0","main":"dist/index.js","module":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.js"},"./package.json":"./package.json"},"scripts":{"ts-types":" tsc --emitDeclarationOnly --outDir dist","build":"npm run lint && rimraf dist && NODE_ENV=production node esbuild.js && npm run ts-types","demo-test":"for file in demo/*.js; do node $file; done","prettier":"prettier --write .","lint":"eslint . --ext .ts","prepare":"husky install","dev":"jest --watch","test":"jest --no-cache"},"prepare":"npm run build","devDependencies":{"@types/jest":"^29.2.0","@types/node":"^18.11.7","@typescript-eslint/eslint-plugin":"^5.41.0","@typescript-eslint/parser":"^5.41.0","esbuild":"^0.15.12","eslint":"^8.26.0","husky":"^8.0.1","jest":"^29.2.2","lint-staged":"^13.0.3","prettier":"^2.7.1","rimraf":"^3.0.2","ts-jest":"^29.0.3","typescript":"^4.8.4"},"lint-staged":{"**/*.{js,jsx,ts,tsx}":["npx prettier --write","npx eslint --fix"]},"repository":{"type":"git","url":"git://github.com/Cadienvan/event-emitter.git"},"license":"MIT","author":{"name":"Michael Di Prisco","email":"cadienvan@gmail.com"},"gitHead":"254898d62b136be167ff2bb08a6be01b7f848e00","description":"This is a function which returns a simple EventEmitter.   It is a simpler implementation of the EventEmitter class from NodeJS.   It is not meant to be a replacement for the NodeJS EventEmitter, but rather a simple alternative for those who don't want to ","bugs":{"url":"https://github.com/Cadienvan/event-emitter/issues"},"homepage":"https://github.com/Cadienvan/event-emitter#readme","_id":"@cadienvan/event-emitter@0.1.0","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-fEtYTGC/pr2uanqpHijTIsJPQTkon+MNyHqvtpWgxlkbKOO2eG3i4fq4z2cR8fl8uFTi76GHK4oP1QB62IDf3w==","shasum":"8ddd10c4f8538926fe7b673dfdf11d56812cc03e","tarball":"https://registry.npmjs.org/@cadienvan/event-emitter/-/event-emitter-0.1.0.tgz","fileCount":5,"unpackedSize":6399,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD+nwTsGZ5TbYSj2dkIelVRgqDLLZP0FcSDgU23j9IJZAIgSXbeE3vpWgVkaB1MabLvxeCYszv5z01uB/IIBUZhuGc="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjlW/nACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpkww/+MZbT/ENAoh6AHXK0TT/KPTmhRYdgLWroAGqj2KeHzxPxfBsA\r\nfWs0vfh+qR1DDHc22tcK/subQ/8W2R7PlADVQppnSSrGLDt5mrxNW9zSX0gJ\r\nYUu1MtpGz0yZXbClNU+JIzwwn8NJtzFbJStDLMF+OwQTsvsgValOC0ke3DfQ\r\n/MgXcH1/3qADlKaYVZbaVEzGS2nfRcklDE46iGsxC+JlOfYZVxRyaBLmOV04\r\nOUJ1eW96n6B59Weiv8dOw1p1crcSjkwq7/n3yHX9hDiEZlF624GSYvopPm9+\r\nEuQId54fr3wb9BJ1FIVyCmPxg0+uV+PQjY+KRv86e2R9Q+4fjdHlK9k4cXcV\r\nL8eas3hFiP719TioQ2IykMT7VgdMKBSxzLBxs2mJUYcWcDue4mCkF83YSyVj\r\n5zRDHZu8ob8v3ynIAdilT9285bjq0VlYBGaZOD6MrNvS2IhAKjGhhW+8tE2b\r\nIkhY+Q4TLpgUaPQlFSsQbaeugRWmqsoz83OnALEfXzzqNwMTu0HQ5Ua2Cr27\r\njFP6jREN35CgIJyCFyY/4dPSqAPo13ER4lrZuBmj3gTNf0J3NiSkSDNKdy+a\r\n7WU7kFlice0EMLqAhYop60hjZ/UHkAItDpwVzLnTRJZwhUq9howT9cbbkmq+\r\n7GQElF1Sg2K2ks376ekscRhakZoS9W9uxaM=\r\n=B+HB\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"cadienvan","email":"cadienvan@gmail.com"},"directories":{},"maintainers":[{"name":"cadienvan","email":"cadienvan@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/event-emitter_0.1.0_1670737894839_0.8488857054335803"},"_hasShrinkwrap":false},"0.1.1":{"name":"@cadienvan/event-emitter","private":false,"version":"0.1.1","main":"dist/index.js","module":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.js"},"./package.json":"./package.json"},"scripts":{"ts-types":" tsc --emitDeclarationOnly --outDir dist","build":"npm run lint && rimraf dist && NODE_ENV=production node esbuild.js && npm run ts-types","demo-test":"for file in demo/*.js; do node $file; done","prettier":"prettier --write .","lint":"eslint . --ext .ts","prepare":"husky install","dev":"jest --watch","test":"jest --no-cache"},"prepare":"npm run build","devDependencies":{"@types/jest":"^29.2.0","@types/node":"^18.11.7","@typescript-eslint/eslint-plugin":"^5.41.0","@typescript-eslint/parser":"^5.41.0","esbuild":"^0.15.12","eslint":"^8.26.0","husky":"^8.0.1","jest":"^29.2.2","lint-staged":"^13.0.3","prettier":"^2.7.1","rimraf":"^3.0.2","ts-jest":"^29.0.3","typescript":"^4.8.4"},"lint-staged":{"**/*.{js,jsx,ts,tsx}":["npx prettier --write","npx eslint --fix"]},"repository":{"type":"git","url":"git://github.com/Cadienvan/event-emitter.git"},"license":"MIT","author":{"name":"Michael Di Prisco","email":"cadienvan@gmail.com"},"gitHead":"7bbf01dd2aeaf93a87ed2744187ef0f9d238dde8","description":"This is a function which returns a simple EventEmitter.   It is a simpler implementation of the EventEmitter class from NodeJS.   It is not meant to be a replacement for the NodeJS EventEmitter, but rather a simple alternative for those who don't want to ","bugs":{"url":"https://github.com/Cadienvan/event-emitter/issues"},"homepage":"https://github.com/Cadienvan/event-emitter#readme","_id":"@cadienvan/event-emitter@0.1.1","_nodeVersion":"20.0.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-N42/9YvGY+EVnDQeuvk3VPwPxiFHkcF5aPNFzhbp5UiXtDiLIQmbgaMmAVUaX6+qKYwlrruQEnvkuWlVrpRbxQ==","shasum":"45b19ab019994da14fa4dd9d6131d042a90419c0","tarball":"https://registry.npmjs.org/@cadienvan/event-emitter/-/event-emitter-0.1.1.tgz","fileCount":5,"unpackedSize":6399,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAJwk8c1qeEbVtD+S1cKhx35Cb8OpaZBa3/HdcurnToiAiEA6FXrAWz/TCqeavX5fUAwg9Ns8PWgrIfBb3/Pdl4BzkY="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkQ/2NACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqpQw/7Boyt8WjQ56tixbD0g4sita/l5ctBfcnEmw76Kzd3T5yg3Ovw\r\nfDj0BaWLQU60SyABBKXUaeiIqIa4NwSlo5v5+taPEsrdfvWlzjOw6u8zLJ3+\r\nzEQUzCDP37jCIkICOcs2ebA62fQGlS4vfRTL+RfX0uexsoqw3x5yn2JXxJ4x\r\n2E90PFp+z6rlGj1bvxgsozpCJd734pPEfnfv16i+OnI06psZbh73DVbxW9OV\r\n2+whUj2zgn9dcjMGF4ndNyvl0NxD6Ho6ZqOyNA82jsFTarYeDtVTSDK3uTsl\r\nZYCO95POQsHuKLStTQwfINGrCJAXOh/4LPHkeMr4qpLxg56NMy3EL8BUUNsR\r\nbf9Cb+bSZrn7TMTnPfrMHLav6Zmp7+k/csXW/iSuQ6HbanASuWHzsrNwJ1hh\r\nhb+WYKU6/8qCYGK1HBjALPynAxrjO5O3mnE864L6vO2VBWvIbOArSudl3EMZ\r\niWrGYESMteaYe65JIGVgOsrOopTS3HGkkDe/9A8G76Bv0s7zEJvPGv9ps7zU\r\nmctesBBC7fiI7YwQgt0C24B+RIHHGtNRNHrwd95H6QIjr9Qjy6UNEmO01vsz\r\nuoyduUIteByX24QCouuHX1BbQSgaNOCsnuSuvfJM/2bnaUe4ojyU4w0q6jw7\r\nYgMesbEMgOY6Z5CYFy/UFsPQ20POXf9LCig=\r\n=i/jm\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"cadienvan","email":"cadienvan@gmail.com"},"directories":{},"maintainers":[{"name":"cadienvan","email":"cadienvan@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/event-emitter_0.1.1_1682177421144_0.2823301743066886"},"_hasShrinkwrap":false},"0.1.2":{"name":"@cadienvan/event-emitter","private":false,"version":"0.1.2","main":"dist/index.js","module":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.js"},"./package.json":"./package.json"},"scripts":{"ts-types":" tsc --emitDeclarationOnly --outDir dist","build":"npm run lint && rimraf dist && NODE_ENV=production node esbuild.js && npm run ts-types","demo-test":"for file in demo/*.js; do node $file; done","prettier":"prettier --write .","lint":"eslint . --ext .ts","prepare":"husky install","dev":"jest --watch","test":"jest --no-cache"},"prepare":"npm run build","devDependencies":{"@types/jest":"^29.5.11","@types/node":"^20.10.5","@typescript-eslint/eslint-plugin":"^6.16.0","@typescript-eslint/parser":"^6.16.0","esbuild":"^0.19.10","eslint":"^8.56.0","husky":"^8.0.3","jest":"^29.7.0","lint-staged":"^15.2.0","prettier":"^3.1.1","rimraf":"^5.0.5","ts-jest":"^29.1.1","typescript":"^5.3.3"},"lint-staged":{"**/*.{js,jsx,ts,tsx}":["npx prettier --write","npx eslint --fix"]},"repository":{"type":"git","url":"git://github.com/Cadienvan/event-emitter.git"},"license":"MIT","author":{"name":"Michael Di Prisco","email":"cadienvan@gmail.com"},"_id":"@cadienvan/event-emitter@0.1.2","gitHead":"b2654ae88b7ca49e85d450561b72ca2cb6abbf58","description":"This is a function which returns a simple EventEmitter.   It is a simpler implementation of the EventEmitter class from NodeJS.   It is not meant to be a replacement for the NodeJS EventEmitter, but rather a simple alternative for those who don't want to ","bugs":{"url":"https://github.com/Cadienvan/event-emitter/issues"},"homepage":"https://github.com/Cadienvan/event-emitter#readme","_nodeVersion":"20.10.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-64OXli8myg/2ckGZ4EVUCY4Jbsd637QGnEjQaHoTPa4tVJgAROm6I+3UhEnB35CZrWBdhagP5mndElXVfB9Rbw==","shasum":"cdcdf6a8e433a8fb8233e3feedf8ec758ab75fcb","tarball":"https://registry.npmjs.org/@cadienvan/event-emitter/-/event-emitter-0.1.2.tgz","fileCount":3,"unpackedSize":4665,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHZ3dm7F9cYDCV57rK5zf+ueA1/92U0lB8pTJ1T1eAeJAiEAroXKuBpBmjxOWBNe/x693BPYpE1xn37f5Mevl0OCPzg="}]},"_npmUser":{"name":"cadienvan","email":"cadienvan@gmail.com"},"directories":{},"maintainers":[{"name":"cadienvan","email":"cadienvan@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/event-emitter_0.1.2_1703671540439_0.2962630798619461"},"_hasShrinkwrap":false}},"time":{"created":"2022-12-10T10:43:48.129Z","0.0.1":"2022-12-10T10:43:48.331Z","modified":"2023-12-27T10:05:40.785Z","0.1.0":"2022-12-11T05:51:34.977Z","0.1.1":"2023-04-22T15:30:21.307Z","0.1.2":"2023-12-27T10:05:40.631Z"},"maintainers":[{"name":"cadienvan","email":"cadienvan@gmail.com"}],"description":"This is a function which returns a simple EventEmitter.   It is a simpler implementation of the EventEmitter class from NodeJS.   It is not meant to be a replacement for the NodeJS EventEmitter, but rather a simple alternative for those who don't want to ","homepage":"https://github.com/Cadienvan/event-emitter#readme","repository":{"type":"git","url":"git://github.com/Cadienvan/event-emitter.git"},"author":{"name":"Michael Di Prisco","email":"cadienvan@gmail.com"},"bugs":{"url":"https://github.com/Cadienvan/event-emitter/issues"},"license":"MIT","readme":"# What is this?\n\nThis is a function which returns a simple EventEmitter.  \nIt is a simpler implementation of the EventEmitter class from NodeJS.  \nIt is not meant to be a replacement for the NodeJS EventEmitter, but rather a simple alternative for those who don't want to use the NodeJS EventEmitter.  \nIt is also a good way to learn how Event Emitting works as a concept.\n\n# How do I install it?\n\nYou can install it by using the following command:\n\n```bash\nnpm install @cadienvan/event-emitter\n```\n\n# How to use it?\n\nSimply import the module and start using it as follows:\n\n```js\nimport { makeEE } from '@cadienvan/event-emitter';\nconst myObject = Object.assign({}, makeEE());\nfunction listener(data) {\n  console.log(data);\n}\nmyObject.$on('event', listener);\nmyObject.$emit('event', {});\n```\n\n## Why did I choose to call it makeEE?\n\nI chose to call it makeEE because it is a function which returns an EventEmitter and I didn't want it to conflict with the NodeJS EventEmitter, allowing you to use both in the same project depending on the use case.\n\n# How does this work?\n\nThe `makeEE` function returns an object with the following properties:\n\n---\n\n### $on\n\nThe `$on` function takes two arguments: the event name and the listener function.\n\n```js\nmyObject.$on('event', listener);\n```\n\n---\n\n### $off\n\nThe `$off` function takes two arguments: the event name and the listener function.\n\n```js\nmyObject.$off('event', listener);\n```\n\n---\n\n### $emit\n\nThe `$emit` function takes two arguments: the event name and the data to be passed to the listener function.\n\n```js\nmyObject.$emit('event', data);\n```\n\n---\n\n### $once\n\nThe `$once` function takes two arguments: the event name and the listener function.\n\n```js\nmyObject.$once('event', listener);\n```\n\n# Tests\n\nYou can run the tests by using the following command:\n\n```bash\nnpm test\n```\n\n# Scaffolding\n\nThis project was generated using Cadienvan's own [npm-package-ts-scaffolding](https://github.com/Cadienvan/npm-package-ts-scaffolding) so it has all the necessary tools to develop, test and publish a TypeScript package importable both via CommonJS and ES Modules.\n","readmeFilename":"README.md"}