{"name":"async-stream-emitter","version":"2.1.0","description":"An alternantive to EventEmitter using consumable 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":"^6.1.0"},"gitHead":"05419c119d8926669a7083b3121370d0f2fbdeda","_id":"async-stream-emitter@2.1.0","_npmVersion":"5.6.0","_nodeVersion":"10.0.0","_npmUser":{"name":"topcloudsystems","email":"grosjona@yahoo.com.au"},"dist":{"integrity":"sha512-ycx7H9jRH9sfBX+fcvk4r5NvAZLI7Rj5/yptDDqj5K2WCQjj+BKjvdzgoJ3xrL3EQiCyB2sR+KsvivSk5lXWTQ==","shasum":"7034cbe20164eb14405ca541f7ae49be272da3e0","tarball":"http://registry-npm.ywwl.com/async-stream-emitter/download/async-stream-emitter-2.1.0.tgz","fileCount":5,"unpackedSize":7708,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcbyJsCRA9TVsSAnZWagAAg6YP+QCnsEfpPTkzP3UY+LLM\nNVBNkElIBnu9MPlDCXtpHJWqSWn1EjLfNgcKlx7dLf2h4B2OXn/jNzTbcSVX\n7tOeqFZlneKN3rys8senZ56bTprOR+ppP95aiZEQcckLMaMqOe08GczFQLxN\n3L0jdsTRXWnj9G/Ro3kV3AObkHD7naab1ezX2zif4Avdw3RxojnT04jE07oN\nD18l/P1ImDr4ruOOx1N/+qd8yzuGsJTsCdiNkgSwR70VhympSgUIXTt7NmLi\nRt+nfjkNEDInZ5XdTcnYw8UzNRmMHFEG0/2Mn6ZlRLs/Fhyc33e6ndJ4o2bp\nIxMN56Kz9MWCCdLj/TzaCtqOpHNwUt5rJDasXGgKDWUhX0iUEBCfq26rC2a8\nvyarpTJnS/IJmRP/yQnHD2AqGZO7yUEXnAUEdvbLrI809A3Hh0KDCueNQ/aC\nmNMa06L6EE3nlri7B7STsyL1xdAEbyg4bUOcSTypcfCOwSDpVPJWbwn/XRX1\nwgmulqggMVY9+wgZuZqxp4SCAdlGSJx2eKG574O2+k2rAtMNeHbnPI7qE2ok\nCgTJ1wYAix2NGF9wy8jmc24xRIoO+RjDuiYA8CvG7B44NhaBZxY8pUH/5DSM\nhTKJ091/ki4H2uNxOpkrZytSH2pb83xYlCJCdot39A6tF4z0GKwdod7Ht7GM\nr2eh\r\n=V1pi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDpFmSMCODzimpcD4BdzJ3/6TLRdawCSzxTJ9hAD3Sr2wIgfC0rgVq5aSAd1f1OeLI3LZDVF/URpHrddLzjSg0CtFw="}],"size":2540,"noattachment":false,"key":"/async-stream-emitter/-/async-stream-emitter-2.1.0.tgz"},"maintainers":[{"name":"topcloudsystems","email":"grosjona@yahoo.com.au"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/async-stream-emitter_2.1.0_1550787179558_0.1740280323629062"},"_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":1550787179696,"_cnpm_publish_time":1550787179696,"dist-tags":{"latest":"7.1.1"}}