{"maintainers":[{"name":"anonymous","email":"sawchuk@gmail.com"}],"keywords":["stream","events","read","write","duplexify","lazy-stream"],"dist-tags":{"latest":"1.0.5"},"author":{"name":"Stephen Sawchuk"},"description":"Get an event when you're being sent data or asked for it.","readme":"# stream-events\n\n> Get an event when you're being sent data or asked for it.\n\n## About\n\nThis is just a simple thing that tells you when `_read` and `_write` have been called, saving you the trouble of writing this yourself. You receive two events `reading` and `writing`-- no magic is performed.\n\nThis works well with [duplexify](https://github.com/mafintosh/duplexify) or lazy streams, so you can wait until you know you're being used as a stream to do something asynchronous, such as fetching an API token.\n\n\n## Use\n```sh\n$ npm install --save stream-events\n```\n```js\nvar stream = require('stream')\nvar streamEvents = require('stream-events')\nvar util = require('util')\n\nfunction MyStream() {\n  stream.Duplex.call(this)\n  streamEvents.call(this)\n}\nutil.inherits(MyStream, stream.Duplex)\n\nMyStream.prototype._read = function(chunk) {\n  console.log('_read called as usual')\n  this.push(new Buffer(chunk))\n  this.push(null)\n}\n\nMyStream.prototype._write = function() {\n  console.log('_write called as usual')\n}\n\nvar stream = new MyStream\n\nstream.on('reading', function() {\n  console.log('stream is being asked for data')\n})\n\nstream.on('writing', function() {\n  console.log('stream is being sent data')\n})\n\nstream.pipe(stream)\n```\n\n### Using with Duplexify\n```js\nvar duplexify = require('duplexify')\nvar streamEvents = require('stream-events')\nvar fs = require('fs')\n\nvar dup = streamEvents(duplexify())\n\ndup.on('writing', function() {\n  // do something async\n  dup.setWritable(/*writable stream*/)\n})\n\nfs.createReadStream('file').pipe(dup)\n```","repository":{"type":"git","url":"git+https://github.com/stephenplusplus/stream-events.git"},"users":{"davidbwaters":true},"bugs":{"url":"https://github.com/stephenplusplus/stream-events/issues"},"license":"MIT","versions":{"1.0.0":{"name":"stream-events","version":"1.0.0","description":"Get an event when you're being sent data or asked for it.","main":"index.js","scripts":{"test":"node ./test"},"repository":{"type":"git","url":"https://github.com/stephenplusplus/stream-events"},"keywords":["stream","events","read","write","duplexify","lazy-stream"],"author":{"name":"Stephen Sawchuk"},"license":"MIT","bugs":{"url":"https://github.com/stephenplusplus/stream-events/issues"},"homepage":"https://github.com/stephenplusplus/stream-events","devDependencies":{"duplexify":"^3.2.0"},"dependencies":{"stubs":"^1.0.0"},"gitHead":"9c48046525a140b51cba576c07c278a6e4f79d0c","_id":"stream-events@1.0.0","_shasum":"71d1dd69f06cbc84edfaf9ccdecc41abb4be2d7b","_from":".","_npmVersion":"2.1.3","_nodeVersion":"0.10.32","_npmUser":{"name":"anonymous","email":"sawchuk@gmail.com"},"maintainers":[{"name":"anonymous","email":"sawchuk@gmail.com"}],"dist":{"shasum":"71d1dd69f06cbc84edfaf9ccdecc41abb4be2d7b","tarball":"http://repository.ncinga.com/nexus/content/groups/npm-all/stream-events/-/stream-events-1.0.0.tgz","integrity":"sha512-iw4Cb7HYXSho/kwc2lbYfO4HdSpSIm1B+DQ39T47kwSzV0qdqYi5MpuHcgZ5RZkCxvNa0m4ECoc2vRfXzE8QJQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC7riCXvPG9jci9448Zr/3F5+UsYWiZEvbDtsqxoGuEogIgR51ci4r3KUQRJwqLgycmSA2SvHrdC0fflv7g9FVwpNk="}]},"directories":{}},"1.0.1":{"name":"stream-events","version":"1.0.1","description":"Get an event when you're being sent data or asked for it.","main":"index.js","scripts":{"test":"node ./test"},"repository":{"type":"git","url":"https://github.com/stephenplusplus/stream-events"},"keywords":["stream","events","read","write","duplexify","lazy-stream"],"author":{"name":"Stephen Sawchuk"},"license":"MIT","bugs":{"url":"https://github.com/stephenplusplus/stream-events/issues"},"homepage":"https://github.com/stephenplusplus/stream-events","devDependencies":{"duplexify":"^3.2.0"},"dependencies":{"stubs":"^1.1.0"},"gitHead":"adc423f635728ddb2e13a2abad73423ab86cb283","_id":"stream-events@1.0.1","_shasum":"4fe7b2bbfcc53e6af31087e8c540483f412ce8c6","_from":".","_npmVersion":"2.1.3","_nodeVersion":"0.10.32","_npmUser":{"name":"anonymous","email":"sawchuk@gmail.com"},"maintainers":[{"name":"anonymous","email":"sawchuk@gmail.com"}],"dist":{"shasum":"4fe7b2bbfcc53e6af31087e8c540483f412ce8c6","tarball":"http://repository.ncinga.com/nexus/content/groups/npm-all/stream-events/-/stream-events-1.0.1.tgz","integrity":"sha512-zQYZ3+VgH5ZCwVVWmnapjiK3WfxonhiroM0FdSLlQadafALm0duxJcUO+fuiBr31OFW+Q/3s/xNbLcTKUlHCkg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAabAcaIiRRYceNqWqssVrDcMfPpmtbPz7L+NnDpqonNAiEAt7jJ+C3vn44+GCVYBDvcCOUA8rPv637Hi+OQTIUL/X0="}]},"directories":{}},"1.0.2":{"name":"stream-events","version":"1.0.2","description":"Get an event when you're being sent data or asked for it.","main":"index.js","scripts":{"test":"node ./test"},"repository":{"type":"git","url":"git+https://github.com/stephenplusplus/stream-events.git"},"keywords":["stream","events","read","write","duplexify","lazy-stream"],"author":{"name":"Stephen Sawchuk"},"license":"MIT","bugs":{"url":"https://github.com/stephenplusplus/stream-events/issues"},"homepage":"https://github.com/stephenplusplus/stream-events","devDependencies":{"duplexify":"^3.2.0"},"dependencies":{"stubs":"^3.0.0"},"gitHead":"0be7aa919fa4b5aa1a3f57ea60bfee39b94fa3eb","_id":"stream-events@1.0.2","_shasum":"abf39f66c0890a4eb795bc8d5e859b2615b590b2","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.8.0","_npmUser":{"name":"anonymous","email":"sawchuk@gmail.com"},"dist":{"shasum":"abf39f66c0890a4eb795bc8d5e859b2615b590b2","tarball":"http://repository.ncinga.com/nexus/content/groups/npm-all/stream-events/-/stream-events-1.0.2.tgz","integrity":"sha512-1DCZA2cyY1ttsbZwdwgcEhJolv/pcri1SZltxZt1OxVU8eZOI2vhPDp3VP9s7wiqtMo8D3DhqTpOZh2YRa/cMg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBSwyhu20DWMDrkHq8TUa0ufQWgY8ppmYPh3B+5m6Q8DAiEAgndgNQeh48oN+x/MoEnx2wWFEo9ptpAM0NFBS3HYPg4="}]},"maintainers":[{"name":"anonymous","email":"sawchuk@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/stream-events-1.0.2.tgz_1494261289471_0.34139894461259246"},"directories":{}},"1.0.3":{"name":"stream-events","version":"1.0.3","description":"Get an event when you're being sent data or asked for it.","main":"index.js","types":"index.d.ts","files":["index.js","index.d.ts"],"scripts":{"test":"node ./test"},"repository":{"type":"git","url":"git+https://github.com/stephenplusplus/stream-events.git"},"keywords":["stream","events","read","write","duplexify","lazy-stream"],"author":{"name":"Stephen Sawchuk"},"license":"MIT","bugs":{"url":"https://github.com/stephenplusplus/stream-events/issues"},"homepage":"https://github.com/stephenplusplus/stream-events","devDependencies":{"duplexify":"^3.2.0"},"dependencies":{"stubs":"^3.0.0"},"gitHead":"aa8674ddcc672d47be185ad060a45c5789ffff6f","_id":"stream-events@1.0.3","_npmVersion":"5.7.1","_nodeVersion":"9.1.0","_npmUser":{"name":"anonymous","email":"stephenplusplusplus@gmail.com"},"dist":{"integrity":"sha512-SvnBCMhEBQSJml4/ImlWkzGWgchjo1tVxnoBUOa1i1g3BsYNWz4W6a9Hc8VhqfmwJiEGu6tLrGdNRm/K/I4YXw==","shasum":"73502d794e9e03607682e0c21948406cc650e54c","tarball":"http://repository.ncinga.com/nexus/content/groups/npm-all/stream-events/-/stream-events-1.0.3.tgz","fileCount":4,"unpackedSize":2981,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDBaVN7B8sjix3omERep14M2cWhefdmqn5snUblKbdxNQIgBlQnFiVSlGdRRbsNEmRVcE42RCmMEOXkZwiKsxTbw2I="}]},"maintainers":[{"name":"anonymous","email":"sawchuk@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/stream-events_1.0.3_1522673374779_0.7791773091920282"},"_hasShrinkwrap":false},"1.0.4":{"name":"stream-events","version":"1.0.4","description":"Get an event when you're being sent data or asked for it.","main":"index.js","types":"index.d.ts","files":["index.js","index.d.ts"],"scripts":{"test":"node ./test"},"repository":{"type":"git","url":"git+https://github.com/stephenplusplus/stream-events.git"},"keywords":["stream","events","read","write","duplexify","lazy-stream"],"author":{"name":"Stephen Sawchuk"},"license":"MIT","bugs":{"url":"https://github.com/stephenplusplus/stream-events/issues"},"homepage":"https://github.com/stephenplusplus/stream-events","devDependencies":{"duplexify":"^3.2.0"},"dependencies":{"stubs":"^3.0.0"},"gitHead":"542c252c88b1768dc7b9abdc70e969f4b94d1a96","_id":"stream-events@1.0.4","_npmVersion":"5.8.0","_nodeVersion":"9.1.0","_npmUser":{"name":"anonymous","email":"stephenplusplusplus@gmail.com"},"dist":{"integrity":"sha512-D243NJaYs/xBN2QnoiMDY7IesJFIK7gEhnvAYqJa5JvDdnh2dC4qDBwlCf0ohPpX2QRlA/4gnbnPd3rs3KxVcA==","shasum":"73bfd4007b8f677b46ec699f14e9e2304c2f0a9e","tarball":"http://repository.ncinga.com/nexus/content/groups/npm-all/stream-events/-/stream-events-1.0.4.tgz","fileCount":4,"unpackedSize":2989,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD7hv3NAvVD6RN7LreAuM9OINr9Ajzpk4yGCQ3D/bcQZgIgUiSLjf4C78LC0mArFmubwd+DC2znUaBKMSKGNCP3yVs="}]},"maintainers":[{"name":"anonymous","email":"sawchuk@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/stream-events_1.0.4_1523639875066_0.6791485458004121"},"_hasShrinkwrap":false},"1.0.5":{"name":"stream-events","version":"1.0.5","description":"Get an event when you're being sent data or asked for it.","main":"index.js","types":"index.d.ts","scripts":{"test":"node ./test"},"repository":{"type":"git","url":"git+https://github.com/stephenplusplus/stream-events.git"},"keywords":["stream","events","read","write","duplexify","lazy-stream"],"author":{"name":"Stephen Sawchuk"},"license":"MIT","bugs":{"url":"https://github.com/stephenplusplus/stream-events/issues"},"homepage":"https://github.com/stephenplusplus/stream-events","devDependencies":{"duplexify":"^3.2.0"},"dependencies":{"stubs":"^3.0.0"},"gitHead":"b53b9533cbccbad8dd50633ab95b6f3fe4e6258e","_id":"stream-events@1.0.5","_npmVersion":"6.4.1","_nodeVersion":"10.11.0","_npmUser":{"name":"anonymous","email":"stephenplusplusplus@gmail.com"},"dist":{"integrity":"sha512-E1GUzBSgvct8Jsb3v2X15pjzN1tYebtbLaMg+eBOUOAxgbLoSbT2NS91ckc5lJD1KfLjId+jXJRgo0qnV5Nerg==","shasum":"bbc898ec4df33a4902d892333d47da9bf1c406d5","tarball":"http://repository.ncinga.com/nexus/content/groups/npm-all/stream-events/-/stream-events-1.0.5.tgz","fileCount":4,"unpackedSize":3028,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb00q9CRA9TVsSAnZWagAA5wAP/1Uc9n18wgEu2mIhdMRs\npEnT+GkLiH5W3Djma26uJrbJP94YPMWQpbAuxdkzHJwHR01cO+ADCacQT19o\nkHoZXK4IjAdjtp/k6IdzUzhvRHGOeH+JPRgh5ANqwjpDH19FWnl8Ayf+3xno\nZwN+IexuB7s9I9vCn+JsqBrnkLTKMfZhhd3OJP5tInKTL6ipK/TAfvFdYWXN\nGiBcZPTE1YkEr2zmTVRNII5zOq7vMM2h1dGy8tySRxRpsZn9XRHCA1KjrHa5\nAGXiOGNlb3ezYbn3FcKeuF/3dEdPogGZii5WU2+t9nQhVW5PToBA96rDATI7\naEQOJZ/Fjv7U49Ij/+BCTZwY9A79AB0+PCf6Bw9IPFuzygbBIJ0hZYWGEVuX\nwd35QULBUrO6+sGVPANl9rPVp0woSQU9DcbFrm2ZBC1fjZ2UnJWbeg1XSqzk\nZePEXnb4gEmsGw6zK8SDksocBpWUKBlmI0oqdGNAR2MPYIvWXZUu6nPQ2SS/\ngxDuHmSGKFK/Yw8wnmnaxbmpKyRXDYH1dRSHt9UnVJOuPYc0OwavVysGx47J\nTHbtVkoB4kH7Iblw107hlr7bIvq42PgqiNH0Vts64oOgn5SeYp86CaS/CrZn\nrOzDX4cysyiDETS0Qu4J1btFsAzOc9+y/9skgjif37fIb7KsCpZ48tb/WaxO\nSeEC\r\n=VlKZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEXx6sbhkoSX2OXTIbaVQKnkb+e1RD+tla6gvEYOj52fAiBryRObJsnYQhnnP2VEivg0Nu3Cc0W/bT0SJh12MDqMAg=="}]},"maintainers":[{"name":"anonymous","email":"sawchuk@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/stream-events_1.0.5_1540573884573_0.691532400787328"},"_hasShrinkwrap":false}},"name":"stream-events","time":{"modified":"2022-06-27T00:46:42.834Z","created":"2014-10-16T22:51:03.471Z","1.0.0":"2014-10-16T22:51:03.471Z","1.0.1":"2014-10-16T23:19:15.702Z","1.0.2":"2017-05-08T16:34:51.280Z","1.0.3":"2018-04-02T12:49:34.858Z","1.0.4":"2018-04-13T17:17:56.302Z","1.0.5":"2018-10-26T17:11:24.761Z"},"readmeFilename":"readme.md","homepage":"https://github.com/stephenplusplus/stream-events"}