{"name":"async-stream-emitter","version":"3.0.2","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":"^7.0.1"},"gitHead":"793122c2080c87e1f26de8097aa9cd11160fc939","_id":"async-stream-emitter@3.0.2","_npmVersion":"5.6.0","_nodeVersion":"10.0.0","_npmUser":{"name":"topcloudsystems","email":"grosjona@yahoo.com.au"},"dist":{"integrity":"sha512-ePv3Miiar2HvigdiWbYRPHqNxFMBZWnUWcBag0CIQNTIolgq7D6ESxrX+8xhpbYN35xGCJ8Mq+WtqBifjH+ojQ==","shasum":"7ad17b6f697587db98d271f930db1e8794dc3846","tarball":"http://registry-npm.ywwl.com/async-stream-emitter/download/async-stream-emitter-3.0.2.tgz","fileCount":5,"unpackedSize":7926,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcerDMCRA9TVsSAnZWagAAyzsQAIWTBtoNT8qcUu3Paaa3\nPRKcqABeIQo8mkUF+iyQPSuYLPr0HMt1AxUzlW0/Fyeu9iMfJApnSNGtJGjN\nD5WSKw+VHIunMFuBakmgW3LhaPqanq92jhG41ufe7hgfBPQ2wmOhRnxhxHX0\nlRav0PlepUZnQr3xK9LksI8agxmIxUxmfXNmrRR8knint+1XkIriWHzF65KY\neJFs+9jPCHkR8s+ajCJCIc5FkP/Qso9gFSJq8BN61yjNewrxKiCBXatq70GL\nUHsWsARWodhzZ/1b0SvqP1C9sSmAslKjvQqPbwgO/v8ReMtSDw/KCeXwFTA9\nUfaEp9HTCkS0U1mrgK+3LHPg2L9o7dcEvr9t+w5eTVxISFdNQKH6cbDOUguM\nZVwgloLkRyso+Qt/3jzE5/RTLa0OEeEQrJGytgz8MFFYDh9rTY97GMkivYAN\nplooxF0DQ2aTFLr3JP9u9Avr7mzAxwPKr2ywOKpghwkRdylREQKAt5x0nXFN\nPEqNXMGBUr6CxuuzMuCusEl5Yo3+5mHb6MgCrah+jF2Y2zAmrlhHXHxJwKZT\nWBEUW8e9i5u78Epq1wVPIJRzooTZOnZ0nGGRBfg+SxQzK9Y7BofXgEEmsmsw\nl8cHbEwhoy5JhdIZi7KguHo3Dq+xrE5j1ErUwhPOfnS4sqjhSDpxtqla1xMt\no0qw\r\n=Z4Fx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGcBjgLFuj28wUwPE1sXBZDwjhnwgeBPxCb5HLbnPldoAiEA/5oWKncUm1OuAe8n+VCjiWapZxAlBEDKpJcPTss5XMM="}],"size":2562,"noattachment":false,"key":"/async-stream-emitter/-/async-stream-emitter-3.0.2.tgz"},"maintainers":[{"name":"topcloudsystems","email":"grosjona@yahoo.com.au"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/async-stream-emitter_3.0.2_1551544523565_0.9837817459322489"},"_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":1551544523661,"_cnpm_publish_time":1551544523661,"dist-tags":{"latest":"7.1.1"}}