{"name":"async-stream-emitter","version":"6.0.1","description":"An alternantive to EventEmitter using consumable streams.","main":"index.js","scripts":{"build":"rollup --config ./rollup.config.js","test":"./node_modules/mocha/bin/_mocha --reporter spec --timeout 10000 --slow 10000"},"repository":{"type":"git","url":"git+https://github.com/SocketCluster/async-stream-emitter.git"},"keywords":["iterable","async","stream","event","emitter","for-await-of"],"author":{"name":"Jonathan Gros-Dubois"},"license":"MIT","bugs":{"url":"https://github.com/SocketCluster/async-stream-emitter/issues"},"homepage":"https://github.com/SocketCluster/async-stream-emitter#readme","devDependencies":{"@rollup/plugin-commonjs":"^25.0.4","@rollup/plugin-node-resolve":"^15.2.1","@rollup/plugin-terser":"^0.4.3","mocha":"^10.2.0","rollup":"^3.28.1"},"dependencies":{"stream-demux":"^9.0.2"},"gitHead":"89bdbd5615f0bc200c30d227ca2a88be867f0353","_id":"async-stream-emitter@6.0.1","_nodeVersion":"16.16.0","_npmVersion":"8.17.0","dist":{"integrity":"sha512-83l3jwRWnLxicAUWe0soECasl4eLgU2apMl9rdG/Pujng4k4sZyb6+Va1Msx1UUSZjVs9F6eWm1E/REJUbruZg==","shasum":"cfc87fd941b7b25af7b7e8c6868108957e113aa7","tarball":"http://registry-npm.ywwl.com/async-stream-emitter/download/async-stream-emitter-6.0.1.tgz","fileCount":8,"unpackedSize":19655,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDYIAlckJ2torhfhdTy3p8HO7s02Kofye8yjCkQ5E+mOAiEAjzePapq3zLJEtBnqx4YyOjjsCsR2JH4hrpEbyOAwaBE="}],"size":5121,"noattachment":false,"key":"/async-stream-emitter/-/async-stream-emitter-6.0.1.tgz"},"_npmUser":{"name":"topcloudsystems","email":"grosjona@yahoo.com.au"},"directories":{},"maintainers":[{"name":"topcloudsystems","email":"grosjona@yahoo.com.au"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/async-stream-emitter_6.0.1_1694094722210_0.9188729240493532"},"_hasShrinkwrap":false,"readme":"# async-stream-emitter\nEventEmitter using ConsumableStream.\n\n## Main methods:\n\n- emit(eventName, data)\n- listener(eventName)\n- closeListener(eventName)\n- closeAllListeners()\n- killListener(eventName)\n- killAllListeners()\n- getListenerBackpressure(eventName)\n- getAllListenersBackpressure()\n\n## Usage examples\n\n```js\nlet emitter = new AsyncStreamEmitter();\n\n(async () => {\n  await wait(10);\n  emitter.emit('foo', 'hello');\n\n  // This will cause all for-await-of loops for that event to exit.\n  // Note that you can also use the 'break' statement inside\n  // individual for-await-of loops.\n  emitter.closeListener('foo');\n})();\n\n(async () => {\n  for await (let data of emitter.listener('foo')) {\n    // data is 'hello'\n  }\n  console.log('The listener was closed.');\n})();\n\n// Utility function.\nfunction wait(duration) {\n  return new Promise((resolve) => {\n    setTimeout(() => {\n      resolve();\n    }, duration);\n  });\n}\n```\n","publish_time":1694094722407,"_cnpm_publish_time":1694094722407,"dist-tags":{"latest":"7.1.1"}}