{"name":"async-stream-emitter","version":"7.1.0","keywords":["iterable","async","stream","event","emitter","for-await-of"],"author":{"name":"Jonathan Gros-Dubois"},"license":"MIT","_id":"async-stream-emitter@7.1.0","maintainers":[{"name":"topcloudsystems","email":"grosjona@yahoo.com.au"}],"homepage":"https://github.com/SocketCluster/async-stream-emitter#readme","bugs":{"url":"https://github.com/SocketCluster/async-stream-emitter/issues"},"dist":{"shasum":"11aa21c922c2527104e38523e712625f36e4e94e","tarball":"http://registry-npm.ywwl.com/async-stream-emitter/download/async-stream-emitter-7.1.0.tgz","fileCount":8,"integrity":"sha512-1EzeJxKjaBYFMESy49dXwxnFE8YorZVw1Nm2fd27wIK7iqtdIdIVD0PYx6LXeryLN4Lzg7nHZ6CNJp3o2U70Og==","signatures":[{"sig":"MEUCIHRsCIFhdgZyJ7ud4BcuVFC+ooZ/G//9oK0hZ3v0LSFqAiEA6gP/rW/RW9tw9UvffJGNtsREbsqLPgCEZWZXsEct2dQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEQCICpJqdbk4Qbb/G2iA9wvSC+zR4chMBOD6FH7E4S6+QaYAiBT1PNJQc9rs94pUge5xLunt+zc2+mYVeqNz+onR73mHg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":28166,"size":6255,"noattachment":false,"key":"/async-stream-emitter/-/async-stream-emitter-7.1.0.tgz"},"main":"index.js","gitHead":"2db1355a40ab3d1ccf9dc7f322d250e401f0e53e","scripts":{"test":"mocha --reporter spec --timeout 10000 --slow 10000","build":"rollup --config ./rollup.config.js"},"_npmUser":{"name":"topcloudsystems","email":"grosjona@yahoo.com.au"},"repository":{"url":"git+https://github.com/SocketCluster/async-stream-emitter.git","type":"git"},"_npmVersion":"11.6.2","description":"An alternantive to EventEmitter using consumable streams.","directories":{},"_nodeVersion":"24.11.1","dependencies":{"stream-demux":"^10.2.1"},"_hasShrinkwrap":false,"devDependencies":{"mocha":"^12.0.3","rollup":"^3.28.1","@rollup/plugin-terser":"^1.0.0","@rollup/plugin-commonjs":"^25.0.4","@rollup/plugin-node-resolve":"^15.2.1"},"_npmOperationalInternal":{"tmp":"tmp/async-stream-emitter_7.1.0_1791534328669_0.8701702578094432","host":"s3://npm-registry-packages-npm-production"},"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":1791534328758,"_cnpm_publish_time":1791534328758,"dist-tags":{"latest":"7.1.1"}}