{"id":21356767,"url":"https://github.com/rousan/read-all","last_synced_at":"2025-07-13T00:31:34.016Z","repository":{"id":57311521,"uuid":"174317134","full_name":"rousan/read-all","owner":"rousan","description":"Read all data from a Readable stream with Promise","archived":false,"fork":false,"pushed_at":"2019-03-08T16:05:19.000Z","size":14,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-24T01:44:44.779Z","etag":null,"topics":["all","buffer","bytes","node","read","readable","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/rousan.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}},"created_at":"2019-03-07T09:50:39.000Z","updated_at":"2020-03-14T04:29:16.000Z","dependencies_parsed_at":"2022-09-10T22:10:42.399Z","dependency_job_id":null,"html_url":"https://github.com/rousan/read-all","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/rousan/read-all","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rousan%2Fread-all","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rousan%2Fread-all/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rousan%2Fread-all/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rousan%2Fread-all/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rousan","download_url":"https://codeload.github.com/rousan/read-all/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rousan%2Fread-all/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265075543,"owners_count":23707509,"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":["all","buffer","bytes","node","read","readable","stream"],"created_at":"2024-11-22T04:36:05.582Z","updated_at":"2025-07-13T00:31:33.729Z","avatar_url":"https://github.com/rousan.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/rousan/read-all.svg?branch=develop)](https://travis-ci.org/rousan/read-all)\n[![codecov](https://codecov.io/gh/rousan/read-all/branch/develop/graph/badge.svg)](https://codecov.io/gh/rousan/read-all)\n[![NPM version](https://img.shields.io/npm/v/node-read-all.svg)](https://www.npmjs.com/package/node-read-all)\n[![NPM total downloads](https://img.shields.io/npm/dt/node-read-all.svg)](https://www.npmjs.com/package/node-read-all)\n[![Contributors](https://img.shields.io/github/contributors/rousan/read-all.svg)](https://github.com/rousan/read-all/graphs/contributors)\n[![License](https://img.shields.io/github/license/rousan/read-all.svg)](https://github.com/rousan/read-all/blob/master/LICENSE)\n\n# read-all\n\nRead all data from a Readable stream and get notified when Promise is resolved.\n\n## Installation\n\nUsing npm:\n\n```bash\n$ npm install node-read-all\n```\n\nUsing yarn:\n\n```bash\n$ yarn add node-read-all\n```\n\n## Usage\n\n```javascript\nconst fs = require('fs');\nconst readAll = require('node-read-all');\n\nconst rStream = fs.createReadStream('file.txt');\nrStream.setEncoding('utf8');\nreadAll(rStream)\n  .then(data =\u003e console.log(data))\n  .catch(console.error.bind(console));\n```\n\nWhen stream is in object mode:\n\n```javascript\nconst { Transform } = require('stream');\nconst readAll = require('node-read-all');\n\nconst transformStream = new Transform({\n  readableObjectMode: true,\n  transform(chunk, encoding, callback) {\n    this.push({ value: chunk.toString() });\n    callback();\n  },\n});\n\nreadAll(transformStream)\n  .then(data =\u003e console.log(data))\n  .catch(console.error.bind(console));\n\nsetTimeout(() =\u003e {\n  transformStream.write('a');\n  transformStream.write('b');\n  transformStream.write('c');\n  transformStream.end();\n}, 1000);\n```\n\n## Contributing\n\nYour PRs and stars are always welcome.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frousan%2Fread-all","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frousan%2Fread-all","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frousan%2Fread-all/lists"}