{"name":"async-stream-emitter","version":"1.0.1","description":"An alternantive to EventEmitter using async iterable streams.","main":"index.js","scripts":{"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":{"mocha":"^5.2.0"},"dependencies":{"stream-demux":"^4.0.4"},"gitHead":"ad53f89ad75c69eef8a15e4f2459beb356ca765d","_id":"async-stream-emitter@1.0.1","_npmVersion":"5.5.1","_nodeVersion":"9.2.0","_npmUser":{"name":"topcloudsystems","email":"grosjona@yahoo.com.au"},"dist":{"integrity":"sha512-9x5QEwhKDJZesJFE6IockER10Q7Q+aze3vzyNfQ1Z5hTuhoRRM4R6Bx+yPl3jkmrqCMLNjG0irmI2FgdnJcuVg==","shasum":"73917b763a1ce92cde14ddbe44ca18c3a547c24b","tarball":"http://registry-npm.ywwl.com/async-stream-emitter/download/async-stream-emitter-1.0.1.tgz","fileCount":5,"unpackedSize":3421,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcH7hMCRA9TVsSAnZWagAAFZcP/iwwEJ8dVoS0obfo+c7+\nY2vPUeVEtqcX1YFcnf86JPUYHq7IZPXkCjNtNvjWwgPCn8tVKf9/YJpnAdmR\nh9OE1ToUogBJzAlAZdkbFN9jmwRlAS/aE2HShtDePYeG7ZcsXIHpNE8vqYnt\n3+OfAZQ/L5OdrmpxhYq+N6hCRvhathlZn9qXZswVh14CobStw6AV89v1HpLc\nJtkfwP9L3zfvb5twiozKxEmWw35/n5JWsdCYT3W5Ai/CqlO/9LhDwvuPkpHk\nCK04sOW+uojVc1fpbTRohd7H9PjrxK1oItSvyu8u70Ilufnjwe6IL9kwxeKG\nIitNJhjAx5cN8oA/WFYng+5I8MeUuyZlhMD5NcRtEIXOSfGP02V7i9VVklUY\nlotrJVO7MJrtMLpw6mxLjMTDkwUemKeENS7CTNQI8b40j6KT/qXDUSlvMkEs\n8GjPvo8zwp2PS7WcKlU0di69C1QURrS+oDOd/xXojZiE6Y9LyQ17xM7qG0Kp\nQir2hBxhRKHNOSiV/yGQikZy+Hs/euyIvQGALUP5N/0q+4PQIy6iORgbJ9Y1\ndkkdjX6FWnxPixvh+8Z6N6zC6/ob+dDLkiGVG0kivjS/SeXugjAc0K8WQaDU\ncAnrzsxkt+i2yIsp3/nnmFxgEs7S0zfnxnZqWITLim2G5CahOgns3bEVUTbd\naxJ9\r\n=8Z/2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDKhG4CN0E1XdySiBIWVd9AyzjH77BgAaRIvSCql9gmYQIhAPa8Uez2g3G95A06iXPvp17lcQtFgRafRMF7cbX9ulR0"}],"size":1722,"noattachment":false,"key":"/async-stream-emitter/-/async-stream-emitter-1.0.1.tgz"},"maintainers":[{"name":"topcloudsystems","email":"grosjona@yahoo.com.au"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/async-stream-emitter_1.0.1_1545582668329_0.8118952539908504"},"_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":1545582668432,"_cnpm_publish_time":1545582668432,"dist-tags":{"latest":"7.1.1"}}