{"name":"async-stream-emitter","version":"6.0.0","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":"19f9a7d2351b5a832b701ef4b254783505002393","_id":"async-stream-emitter@6.0.0","_nodeVersion":"16.16.0","_npmVersion":"8.17.0","dist":{"integrity":"sha512-bPfnHSIcnzI3E8rapHkFGJ3e6LoNZsCujGqoJCpY2gKvbJpiisCchxOdexTrHXcM6STfM/Tq+wz6jSISXN3YBA==","shasum":"4dafa7d43c7d3d379ad3888cb16e67e7dea420d2","tarball":"http://registry-npm.ywwl.com/async-stream-emitter/download/async-stream-emitter-6.0.0.tgz","fileCount":8,"unpackedSize":19656,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCgR5QW2S//2eylYNM6EWKi20WeTAMtPt/Xd1AEKTqRJQIgARn9q3te1ZnESyuSs8R3wZqtxw6bBgC3biSZ+4tBM6Q="}],"size":5116,"noattachment":false,"key":"/async-stream-emitter/-/async-stream-emitter-6.0.0.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.0_1694094025603_0.579462214878814"},"_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":1694094025829,"_cnpm_publish_time":1694094025829,"dist-tags":{"latest":"7.1.1"}}