{"name":"stream-read-all","version":"5.0.0","keywords":["concat","stream","read","all","collect","buffers","concatenate"],"author":{"name":"Lloyd Brookes","email":"75pound@gmail.com"},"license":"MIT","_id":"stream-read-all@5.0.0","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":"e9bc0b58dc0cbba228762d028989b11466d0933a","tarball":"http://registry-npm.ywwl.com/stream-read-all/download/stream-read-all-5.0.0.tgz","fileCount":5,"integrity":"sha512-jKx7WUpezpAKyu311oinMZZs2BdFNQuXGVz/8LQgiJMlDgXs8zQN3ULEpS3novpkbQtpFX3knr41TgLkysoBjw==","signatures":[{"sig":"MEYCIQCyMIVOEiIGEsgalj2C+QEayDenQpdDg853epfobV6VdgIhAJwc3RETpLeIqv29TtNEROdntYfypPBzojbHy9NVBJUn","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":5706,"size":2407,"noattachment":false,"key":"/stream-read-all/-/stream-read-all-5.0.0.tgz"},"type":"module","engines":{"node":">=12.20"},"exports":{"import":"./index.js","require":"./dist/index.cjs"},"gitHead":"e79dcb7f08d65b3012f85b2dbb84f63140e8d332","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.0_1729181384962_0.9844896413738853","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":1729181385226,"_cnpm_publish_time":1729181385226,"dist-tags":{"latest":"5.0.2"}}