{"name":"stream-read-all","version":"5.0.1","keywords":["concat","stream","read","all","collect","buffers","concatenate"],"author":{"name":"Lloyd Brookes","email":"75pound@gmail.com"},"license":"MIT","_id":"stream-read-all@5.0.1","maintainers":[{"name":"75lb","email":"75pound@gmail.com"}],"homepage":"https://github.com/75lb/stream-read-all#readme","bugs":{"url":"https://github.com/75lb/stream-read-all/issues"},"dist":{"shasum":"a763c19839ad3cad2faad228c6ab547099ac6ec8","tarball":"http://registry-npm.ywwl.com/stream-read-all/download/stream-read-all-5.0.1.tgz","fileCount":5,"integrity":"sha512-bZmHWlpl32dHC/nWNtavURktd5bYSivsewI8ueHc/06ShL0iGawpWkqO3lqLiadq/NYYzjpakHRIsZoY9iGF/A==","signatures":[{"sig":"MEUCIQCXregLBo+nd4/l09QFR3q3eGvhEnCRiu3Y4/gPvEdPxQIgMgYS/us7YCziJnYSnK7/1ainBSYroiVjxmHcGAkj+aU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":5735,"size":2423,"noattachment":false,"key":"/stream-read-all/-/stream-read-all-5.0.1.tgz"},"type":"module","engines":{"node":">=12.20"},"exports":{"import":"./index.js","require":"./dist/index.cjs"},"gitHead":"ff39acbc228a6231a4a4929d1788aaf9f175ce3d","scripts":{"dist":"75lb-nature cjs-build index.js","test":"npm run dist && npm run test:ci","test:ci":"75lb-nature test-runner test.js"},"_npmUser":{"name":"75lb","email":"75pound@gmail.com"},"standard":{"envs":[],"ignore":["tmp","dist"]},"repository":{"url":"git+https://github.com/75lb/stream-read-all.git","type":"git"},"_npmVersion":"10.8.3","description":"Returns a promise which fulfils with the supplied stream's content","directories":{},"_nodeVersion":"22.9.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/stream-read-all_5.0.1_1729181516237_0.032782618520065254","host":"s3://npm-registry-packages"},"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":1729181516388,"_cnpm_publish_time":1729181516388,"dist-tags":{"latest":"5.0.2"}}