{"name":"async-stream-emitter","version":"5.0.0","description":"An alternantive to EventEmitter using consumable streams.","main":"index.js","scripts":{"build":"gulp browserify; gulp minify","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":{"@babel/core":"^7.2.2","@babel/preset-env":"^7.2.3","babel-plugin-minify-dead-code-elimination":"^0.5.0","browserify":"^16.2.3","gulp":"^4.0.0","gulp-babel":"^8.0.0","gulp-cli":"^2.0.1","gulp-convert-newline":"^0.0.3","gulp-insert":"^0.5.0","gulp-rename":"^1.4.0","gulp-uglify":"^3.0.1","mocha":"^5.2.0","uglify-es":"^3.3.9","vinyl-source-stream":"^2.0.0"},"dependencies":{"stream-demux":"^9.0.0"},"gitHead":"5227dfca9563e4eb1ad1ed705bd43854fe90f1dd","_id":"async-stream-emitter@5.0.0","_nodeVersion":"16.16.0","_npmVersion":"8.17.0","dist":{"integrity":"sha512-IbHq5SDpi2wNOJjnPW2uzeYpBrPmcN7ayrqcCDKHGR1TQDGzMDxeO7cNhABAZYfa5K/hmneZSN07C9vHkivvxw==","shasum":"ab866e52be5a07cc8f006a7925079396913c014a","tarball":"http://registry-npm.ywwl.com/async-stream-emitter/download/async-stream-emitter-5.0.0.tgz","fileCount":8,"unpackedSize":34275,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH23ZR1vu7C9rDY0Gj1WoxkPtOLFWwN4yrPmoSABzgYAAiALbi0L/xabPnck60X7rLtQd0Zhiq0tY+UG4omig+U7Rw=="}],"size":7498,"noattachment":false,"key":"/async-stream-emitter/-/async-stream-emitter-5.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_5.0.0_1694031547366_0.2856981243083694"},"_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":1694031547557,"_cnpm_publish_time":1694031547557,"dist-tags":{"latest":"7.1.1"}}