{"name":"end-of-stream","version":"1.4.4","description":"Call a callback when a readable/writable/duplex stream has completed or failed.","repository":{"type":"git","url":"git://github.com/mafintosh/end-of-stream.git"},"dependencies":{"once":"^1.4.0"},"scripts":{"test":"node test.js"},"keywords":["stream","streams","callback","finish","close","end","wait"],"bugs":{"url":"https://github.com/mafintosh/end-of-stream/issues"},"homepage":"https://github.com/mafintosh/end-of-stream","main":"index.js","author":{"name":"Mathias Buus","email":"mathiasbuus@gmail.com"},"license":"MIT","devDependencies":{"tape":"^4.11.0"},"gitHead":"e104395e50015a6436d9747b4b1c2a617b267769","_id":"end-of-stream@1.4.4","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==","shasum":"5ae64a5f45057baf3626ec14da0ca5e4b2431eb0","tarball":"http://registry-npm.ywwl.com/end-of-stream/download/end-of-stream-1.4.4.tgz","fileCount":4,"unpackedSize":6234,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdi2Q7CRA9TVsSAnZWagAA6CoQAILuF0T9HdorFmOUYcIa\nymCYU4se8p+qF7neyhJVZVEe1NzmoY1IS3rteWlAxd+YnWBhHgZkdaEtrb7r\n1ia+sUaUEfnG80YrqUn8Y2yVTBn2FVXd+bpLc3H6IC5LB0iVSq37FJtba8D/\nDGNag9GtWgTU6KB4r5QhLFy4voG4yM2mStGPNjq/Ggw+O5Fnl5FxxwqL/k/t\nxDNdB7vrPyVVBUSvs5lvTijpfDfjpw8d3FbuYD7rJYAwD2GFXmfkCrCtSrf0\nnIabXo1FvgZ8G1eeum7VPsWFosnxv0zjrbQhgUC+dj6pNGJW2f3Chk98CCn9\n4R7aNxyxUzz5+yaUrjL1Z2GCGPs7bpJ4Q2jWDstDiKZW5YtBENMPvXPM+FUc\nEwfy2iFyunDRkT10IscI1tBPA5xQrxv8dBO8SeDBgYcnhza4hN8MMyHb1bF7\n7i24CbGPYRy0vH652y5O3JSWzUVg5vmjjbslRQhSEiEuEsL7joIn5m5Cr32X\ntERspxNxfjbykpkIhafhOGm+XTbNgJ6GuzFS5651RXGMaFqPD7yPNNNmGDVz\nNE7zLNEiRWhZFhITRYhGHRRsYLU3/gN3XkLFHLfd9YHr8IzqDY8EQ8KcuRl8\nvHCIIwvvW9CTolkeQrIhiXjUcUwfUmPPXsJem0u9MCHr5JU8IumnPqNNSyv1\nP/VN\r\n=XlGu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDGSFqJoSTAUMXVoUHI3ODF9gI06zLxQB/nUnO7oCnbpgIhALgXtzVEA9IySG548ds0lZ80yZIHnts3J5upTEY7HF7N"}],"size":2387,"noattachment":false,"key":"/end-of-stream/-/end-of-stream-1.4.4.tgz"},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/end-of-stream_1.4.4_1569416251049_0.7050238023851008"},"_hasShrinkwrap":false,"readme":"# end-of-stream\n\nA node module that calls a callback when a readable/writable/duplex stream has completed or failed.\n\n\tnpm install end-of-stream\n\n[![Build status](https://travis-ci.org/mafintosh/end-of-stream.svg?branch=master)](https://travis-ci.org/mafintosh/end-of-stream)\n\n## Usage\n\nSimply pass a stream and a callback to the `eos`.\nBoth legacy streams, streams2 and stream3 are supported.\n\n``` js\nvar eos = require('end-of-stream');\n\neos(readableStream, function(err) {\n  // this will be set to the stream instance\n\tif (err) return console.log('stream had an error or closed early');\n\tconsole.log('stream has ended', this === readableStream);\n});\n\neos(writableStream, function(err) {\n\tif (err) return console.log('stream had an error or closed early');\n\tconsole.log('stream has finished', this === writableStream);\n});\n\neos(duplexStream, function(err) {\n\tif (err) return console.log('stream had an error or closed early');\n\tconsole.log('stream has ended and finished', this === duplexStream);\n});\n\neos(duplexStream, {readable:false}, function(err) {\n\tif (err) return console.log('stream had an error or closed early');\n\tconsole.log('stream has finished but might still be readable');\n});\n\neos(duplexStream, {writable:false}, function(err) {\n\tif (err) return console.log('stream had an error or closed early');\n\tconsole.log('stream has ended but might still be writable');\n});\n\neos(readableStream, {error:false}, function(err) {\n\t// do not treat emit('error', err) as a end-of-stream\n});\n```\n\n## License\n\nMIT\n\n## Related\n\n`end-of-stream` is part of the [mississippi stream utility collection](https://github.com/maxogden/mississippi) which includes more useful stream modules similar to this one.\n","publish_time":1569416251238,"_cnpm_publish_time":1569416251238,"dist-tags":{"latest":"1.4.5"}}