{"id":16644182,"url":"https://github.com/75lb/stream-read-all","last_synced_at":"2025-10-30T12:30:30.924Z","repository":{"id":57372047,"uuid":"94676314","full_name":"75lb/stream-read-all","owner":"75lb","description":"Returns a promise which fulfils with the supplied stream's content","archived":false,"fork":false,"pushed_at":"2024-12-06T00:39:57.000Z","size":90,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-02T08:31:51.756Z","etag":null,"topics":["nodejs","stream"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/75lb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-06-18T09:01:43.000Z","updated_at":"2024-12-06T00:40:02.000Z","dependencies_parsed_at":"2024-10-19T18:57:17.533Z","dependency_job_id":"4e6539fb-3607-4ec1-9c27-44477f16d668","html_url":"https://github.com/75lb/stream-read-all","commit_stats":{"total_commits":20,"total_committers":1,"mean_commits":20.0,"dds":0.0,"last_synced_commit":"0deec1dcac824e660857e2d29c47e8786555b3b2"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/75lb%2Fstream-read-all","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/75lb%2Fstream-read-all/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/75lb%2Fstream-read-all/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/75lb%2Fstream-read-all/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/75lb","download_url":"https://codeload.github.com/75lb/stream-read-all/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238961345,"owners_count":19559470,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["nodejs","stream"],"created_at":"2024-10-12T08:10:43.412Z","updated_at":"2025-10-30T12:30:30.636Z","avatar_url":"https://github.com/75lb.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"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\u0026copy; 2017-25 Lloyd Brookes \u003copensource@75lb.com\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F75lb%2Fstream-read-all","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F75lb%2Fstream-read-all","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F75lb%2Fstream-read-all/lists"}