{"_id":"async-stream-emitter@7.1.1","bugs":{"url":"https://github.com/SocketCluster/async-stream-emitter/issues"},"dist":{"shasum":"771276fbbc4dfca7b66ee5770587c857a0ff8e73","tarball":"http://registry-npm.ywwl.com/async-stream-emitter/download/async-stream-emitter-7.1.1.tgz","fileCount":8,"integrity":"sha512-GQIiJdGUcmC+Dxk1YqAdkMNuWZzOcaviF/Jzj/IbZYP6kyMieMkgmfuFKVrKhsh7x538P+HMi/xlcZk3lnieXg==","signatures":[{"sig":"MEQCICpZ4EfARTRjOB23GWL5EvcLT6lqOGOcWgTyEvzmw02WAiA83AZ8Mog3BULVVXOlEYF7V7lW+gdjjlqFTB9lOCp1zA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIAzCqSUsUHBQ5QlAhJU9bvXv+kaglaz5eSG3t3Xeqmi9AiBRb5FKFAtkHAQeOB+/wDC+vxvdWhDoqrodibuRhaG9vA=="}],"unpackedSize":28680,"size":6425,"noattachment":false,"key":"/async-stream-emitter/-/async-stream-emitter-7.1.1.tgz"},"main":"index.js","name":"async-stream-emitter","author":{"name":"Jonathan Gros-Dubois"},"gitHead":"7973ffdc33afd86ddb41cb3483f497bc8bc7f7d5","license":"MIT","scripts":{"test":"mocha --reporter spec --timeout 10000 --slow 10000","build":"rollup --config ./rollup.config.js"},"version":"7.1.1","_npmUser":{"name":"topcloudsystems","email":"grosjona@yahoo.com.au"},"homepage":"https://github.com/SocketCluster/async-stream-emitter#readme","keywords":["iterable","async","stream","event","emitter","for-await-of"],"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":{},"maintainers":[{"name":"topcloudsystems","email":"grosjona@yahoo.com.au"}],"_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":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/async-stream-emitter_7.1.1_1791534621342_0.7004938879405063"},"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":1791534621436,"_cnpm_publish_time":1791534621436,"dist-tags":{"latest":"7.1.1"}}