{"name":"end-of-stream","version":"1.4.5","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"},"_id":"end-of-stream@1.4.5","gitHead":"cea89de8165f24e183603e63839522ec22af58df","_nodeVersion":"22.16.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==","shasum":"7344d711dea40e0b74abc2ed49778743ccedb08c","tarball":"http://registry-npm.ywwl.com/end-of-stream/download/end-of-stream-1.4.5.tgz","fileCount":4,"unpackedSize":6295,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDLSRFs7dL/0XPUskLFlHhNIehbW3Nid6/evQJVWRFdPQIgEBLKBFvlnsMDG1xueTbiEt1xhahVAE01AOgQe83MnOU="}],"size":2429,"noattachment":false,"key":"/end-of-stream/-/end-of-stream-1.4.5.tgz"},"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"directories":{},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/end-of-stream_1.4.5_1750080540367_0.2029259267346697"},"_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":1750080540574,"_cnpm_publish_time":1750080540574,"dist-tags":{"latest":"1.4.5"}}