{"id":13659297,"url":"https://github.com/floatdrop/read-all-stream","last_synced_at":"2025-03-15T13:30:49.461Z","repository":{"id":23036544,"uuid":"26389428","full_name":"floatdrop/read-all-stream","owner":"floatdrop","description":"Read stream to buffer or string","archived":false,"fork":false,"pushed_at":"2016-01-27T17:41:20.000Z","size":22,"stargazers_count":15,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-09T05:02:30.061Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/floatdrop.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":"2014-11-09T07:58:25.000Z","updated_at":"2018-02-02T14:55:33.000Z","dependencies_parsed_at":"2022-08-21T09:40:51.020Z","dependency_job_id":null,"html_url":"https://github.com/floatdrop/read-all-stream","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floatdrop%2Fread-all-stream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floatdrop%2Fread-all-stream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floatdrop%2Fread-all-stream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floatdrop%2Fread-all-stream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/floatdrop","download_url":"https://codeload.github.com/floatdrop/read-all-stream/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243735795,"owners_count":20339530,"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":[],"created_at":"2024-08-02T05:01:07.214Z","updated_at":"2025-03-15T13:30:49.165Z","avatar_url":"https://github.com/floatdrop.png","language":"JavaScript","readme":"# read-all-stream [![Build Status][travis-image]][travis-url]\n\n\u003e Read stream to buffer or string\n\n## Install\n\n```\n$ npm install --save read-all-stream\n```\n\n## Usage\n\n```js\nvar read = require('read-all-stream');\nvar stream = fs.createReadStream('index.js');\n\nread(stream).then(function (data) {\n\tconsole.log(data.length);\n});\n\nread(stream, 'utf8', function (err, data) {\n\tconsole.log(data.length);\n\t//=\u003e 42\n});\n\n```\n\n### API\n\n#### read(stream, [options], [callback])\n\nIf callback is omitted, Promise will be returned.\n\n##### stream\n\n*Required*  \nType: `Stream`\n\nEvent emitter, which `data` events will be consumed.\n\n##### options\n\nType: `object` or `string`\n\nIf type of `options` is `string`, then it will be used as encoding.\nIf type is `Object`, then next options are available:\n\n##### options.encoding\n\nType: `string`, `null`  \nDefault: `'utf8'`\n\nEncoding to be used on `toString` of the data. If null, the body is returned as a Buffer.\n\n##### callback(err, data)\n\nWill be called after stream is read.\n\n###### err\n\n`Error` object (if `error` event happens).\n\n###### data\n\nThe data in stream.\n\n## License\n\nMIT © [Vsevolod Strukchinsky](floatdrop@gmail.com)\n\n[travis-url]: https://travis-ci.org/floatdrop/read-all-stream\n[travis-image]: https://img.shields.io/travis/floatdrop/read-all-stream.svg\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffloatdrop%2Fread-all-stream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffloatdrop%2Fread-all-stream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffloatdrop%2Fread-all-stream/lists"}