{"name":"end-of-stream","version":"1.4.2","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":"ec0b5bd655cca50e9ab8ac51319badd0bc357a03","_id":"end-of-stream@1.4.2","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-gUSUszrsxlDnUbUwEI9Oygyrk4ZEWtVaHQc+uZHphVeNxl+qeqMV/jDWoTkjN1RmGlZ5QWAP7o458p/JMlikQg==","shasum":"080bf028edce8312b665ff18ea03cae0c3ac0ecb","tarball":"http://registry-npm.ywwl.com/end-of-stream/download/end-of-stream-1.4.2.tgz","fileCount":4,"unpackedSize":6093,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdiMenCRA9TVsSAnZWagAAP10QAKM60nWk+wPgU77I7Wk+\nKm/8/0V9WSTceq2/w/Kq7m+r78g6EQ9ooc62mvvNwbiL+wIR6jgcsdJ1nW2f\nYV9mlHxFoOLzDfE0xHEcfCv2fRI+GMszVFmQNJoKie7STxUqTSWwbaDLDqny\nrdm4sc64a2/AV/O0rO38liFtykvvyOPJl6lg2Z8vL0hKgDjLlkxpjC7I2j6G\nYj+m3Y90s2LKm6G3+tEn2Owh6HUOJnxxbrWfu0EsaiKHLERraapeWE4F9Rhn\n/wQXqFvtdXOPmehCufzlRauHrvSs2VIshMGbVQAHoqr06qWEzbJqSP7w5qTP\nW+W7uamJ0B7SdHGd4uEzKeagA04A6v0ggspFkvOxpZtDRRuQjp/UfarLmIBc\nu77V8YgrQZNhK41R43r5XWBxDHo7nZfyqT7RZyy6lJ9+vseUmh28fg88oApn\nF4qgVWQPfDCRIFsd5dPHO/ywW26g6u3rUkgB0gisAVzRIXPDDOXlxA2jNaXr\nRX2ibRpKRjuZhkHCWOE2ktQP4Gg2jMxee65lRvpi+4u/+SVu7PuOE4MFmI1f\nPR4njxmvU2aMh30sjgpAhWDbHV4VQ5AyJx2vlrlksm6Ny+gdALdVE7Wk2og0\nah+SpCVh4Of/ZI5O90BM8j89+IUN/TZu5uWj1rLtoJKbGgjXNj12oKONze9Q\nXfpz\r\n=Ntpu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAq7vRTS505FSDhahYVKfCivJzRPEwxY6sYcaRX7PEX0AiEAmuJQlDqZulAlas9RK+JIUBgrOsJaBlUPOaXlWdsJsO8="}],"size":2336,"noattachment":false,"key":"/end-of-stream/-/end-of-stream-1.4.2.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.2_1569245094938_0.18767696658568545"},"_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":1569245095146,"_cnpm_publish_time":1569245095146,"dist-tags":{"latest":"1.4.5"}}