{"name":"end-of-stream","version":"1.4.3","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":"f0227189d092fab31bc7d47ef06c83ee4d702eb6","_id":"end-of-stream@1.4.3","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-cbNhPFS6MlYlWTGncSiDYbdqKhwWFy7kNeb1YSOG6K65i/wPTkLVCJQj0hXA4j0m5Da+hBWnqopEnu1FFelisQ==","shasum":"9db9861620e47283cd49513be9c344f339ec5153","tarball":"http://registry-npm.ywwl.com/end-of-stream/download/end-of-stream-1.4.3.tgz","fileCount":4,"unpackedSize":6087,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdifshCRA9TVsSAnZWagAAz8EP/RMoMnE8J10AVpg+0Fk/\nZzLD1saORsJ0aEiTzIVRGU3DIc8Wzr1k9J4iuiz722+xr9ttNIa8osHo2Izs\newFSfyBghX2Box/oXDpFSsIi+EbK3HFbFJx0lHbeFc7fIpBYQeVQuzX9KIph\nWSvhr3GMlAbWAICnQoLRSlby+FT3CfhdHXKjR1deymaBfIFvz7VSCegJVx/Q\nxk+ZFyQ9XrhrW3zcbWt3bbToCEfAycX4qMajIa5sM08t4M3ZGfwplEIDR9Lw\nIZ0VP61EyZELVyx06R+DRrb0BcM6z6gdYzfXoAEKXrPIIuShqK5tGbaZ9CWZ\nDiwBlzCFNDvpKR+6sdbZUj1/YL6gxYtxBtLES18na7oxdoDRxFeT6+6iHSr8\nawRlkJpbfi2VZzQlP8iMsbbUOimWMtLiV/8oefJLwStJDVDjm7ylMEYgkjwf\nafT9GxeWBpLmRTCqjD+JrfZLPwwLE+QUD6z71sj1/DRoZ1mehinMbNbf+jqK\n/w1aizuiowxWPpYO7EHbIWkkTLZGXLgl5zTw+Nor9/mvY8JKJ5gVgHeKvp6P\nVNRN3Gi+37h0pLb6103oImAX7A/urmsfNWqIYzFJ5HgP8lQikesdexRfO1po\nfJ6/zsQs1r3sF3J0B7GdlJOXSDbBp5NLLo2dguIMk/+SJF8UrPNguk9VCGnM\nnK/i\r\n=N1Mv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCIqj9K4Zh26Tam5a+0/x2Hkmwiw1DijkYKs7MqEqmGdwIhALJlUUa3fNOtwbQqpS9Uh2OIZe5iyhDjAcKAw1vsaaMP"}],"size":2336,"noattachment":false,"key":"/end-of-stream/-/end-of-stream-1.4.3.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.3_1569323808494_0.899865805542279"},"_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":1569323808718,"_cnpm_publish_time":1569323808718,"dist-tags":{"latest":"1.4.5"}}