{"name":"stream-read-all","author":{"name":"Lloyd Brookes","email":"75pound@gmail.com"},"version":"5.0.2","description":"Returns a promise which fulfils with the supplied stream's content","repository":{"type":"git","url":"git+https://github.com/75lb/stream-read-all.git"},"type":"module","exports":{"import":"./index.js","require":"./dist/index.cjs"},"keywords":["concat","stream","read","all","collect","buffers","concatenate"],"license":"MIT","engines":{"node":">=12.20"},"scripts":{"test":"npm run dist && npm run test:ci","test:ci":"75lb-nature test-runner test.js","dist":"75lb-nature cjs-build index.js"},"standard":{"ignore":["tmp","dist"],"envs":[]},"_id":"stream-read-all@5.0.2","gitHead":"ea25d581739ff7dd6495d2eddb6803bcdd254296","bugs":{"url":"https://github.com/75lb/stream-read-all/issues"},"homepage":"https://github.com/75lb/stream-read-all#readme","_nodeVersion":"22.9.0","_npmVersion":"10.8.3","dist":{"integrity":"sha512-1M18jsvuTAEOdqqFYAfkXIsMJ3Fzv/33pezXOfHbGn58RH39tFy7wbrgVizdFrXFZ+zpsSVx7lTOWNtZGOI6JA==","shasum":"a54bcb7ae490072745b9279584d132b3a81622e5","tarball":"http://registry-npm.ywwl.com/stream-read-all/download/stream-read-all-5.0.2.tgz","fileCount":5,"unpackedSize":6384,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDd+EN8pfJX2zQfGJUipu4T0taENmbfWRXxxqW2vL+H+gIgFDLXw5eNxevjnLdAPKelqA2aXgQF04dtibW2hc7p6GA="}],"size":2493,"noattachment":false,"key":"/stream-read-all/-/stream-read-all-5.0.2.tgz"},"_npmUser":{"name":"75lb","email":"75pound@gmail.com"},"directories":{},"maintainers":[{"name":"75lb","email":"75pound@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/stream-read-all_5.0.2_1729257681837_0.0728575901473778"},"_hasShrinkwrap":false,"readme":"[![view on npm](https://badgen.net/npm/v/stream-read-all)](https://www.npmjs.org/package/stream-read-all)\n[![npm module downloads](https://badgen.net/npm/dt/stream-read-all)](https://www.npmjs.org/package/stream-read-all)\n[![Gihub repo dependents](https://badgen.net/github/dependents-repo/75lb/stream-read-all)](https://github.com/75lb/stream-read-all/network/dependents?dependent_type=REPOSITORY)\n[![Gihub package dependents](https://badgen.net/github/dependents-pkg/75lb/stream-read-all)](https://github.com/75lb/stream-read-all/network/dependents?dependent_type=PACKAGE)\n[![Node.js CI](https://github.com/75lb/stream-read-all/actions/workflows/node.js.yml/badge.svg)](https://github.com/75lb/stream-read-all/actions/workflows/node.js.yml)\n[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](https://github.com/feross/standard)\n\n# stream-read-all\n\nReturns a promise which fulfils with the supplied stream's content. Supports any [Readable](https://nodejs.org/docs/latest/api/stream.html#readable-streams) stream as input in either regular or [object mode](https://nodejs.org/docs/latest/api/stream.html#object-mode).\n\nFor example, this script...\n\n```js\nimport { streamReadAll } from 'stream-read-all'\nconst readable = await streamReadAll(process.stdin)\nconsole.log(readable.toString())\n```\n\n...prints this output.\n\n```\n$ echo Hello | node example.js\nHello\n```\n\nThe above `streamReadAll` function returns either a `Buffer` in regular mode or an array of objects in object mode. Alternatively, you can use `streamReadText` which is identical to the above except it returns text. The second argument is optional, specifying the character encoding to use (as in the [buffer.toString()](https://nodejs.org/docs/latest/api/buffer.html#buftostringencoding-start-end) first argument). The default value is 'utf8'.\n\n```js\nimport { streamReadText } from 'stream-read-all'\nconst readable = fs.createReadStream('./package.json')\nconst text = await streamReadText(readable, 'hex')\nconsole.log(text)\n// prints the package.json file content in hex format\n```\n\n* * *\n\n&copy; 2017-25 Lloyd Brookes <opensource@75lb.com>.\n","publish_time":1729257682034,"_cnpm_publish_time":1729257682034,"dist-tags":{"latest":"5.0.2"}}