{"id":17034538,"url":"https://github.com/caub/as-buffer","last_synced_at":"2026-04-10T20:58:29.752Z","repository":{"id":57184531,"uuid":"89249535","full_name":"caub/as-buffer","owner":"caub","description":"Convert a stream (or string, array) to buffer","archived":false,"fork":false,"pushed_at":"2018-06-13T09:31:08.000Z","size":10,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-28T15:26:21.091Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/caub.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-24T14:21:36.000Z","updated_at":"2018-06-13T19:45:38.000Z","dependencies_parsed_at":"2022-08-24T18:20:20.573Z","dependency_job_id":null,"html_url":"https://github.com/caub/as-buffer","commit_stats":null,"previous_names":["caub/read-as-buffer"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caub%2Fas-buffer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caub%2Fas-buffer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caub%2Fas-buffer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caub%2Fas-buffer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/caub","download_url":"https://codeload.github.com/caub/as-buffer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245026042,"owners_count":20549073,"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-10-14T08:43:54.723Z","updated_at":"2026-04-10T20:58:24.704Z","avatar_url":"https://github.com/caub.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Read stream and other types as buffer\\*\n[![npm version][npm-image]][npm-url]\n[![build status][travis-image]][travis-url]\n[![coverage status][codecov-image]][codecov-url]\n\n```js\nconst read = require('as-buffer');\n\nconst stream = fs.createReadStream('./photo.png');\n\nread(stream, { maxsize: 1e6 }) // with a max-size, default to 1e7, 10MiB\n\t.then(buf =\u003e console.log('read', buf))\n\t.catch(e =\u003e console.log('file too large'));\n\n```\n\\*: exception of object-mode streams that are returned as array\n\nlike https://github.com/stream-utils/stream-to-array but simpler\n\n[npm-image]: https://img.shields.io/npm/v/as-buffer.svg?style=flat-square\n[npm-url]: https://www.npmjs.com/package/as-buffer\n[travis-image]: https://img.shields.io/travis/caub/as-buffer.svg?style=flat-square\n[travis-url]: https://travis-ci.org/caub/as-buffer\n[codecov-image]: https://img.shields.io/codecov/c/github/caub/as-buffer.svg?style=flat-square\n[codecov-url]: https://codecov.io/gh/caub/as-buffer\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaub%2Fas-buffer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcaub%2Fas-buffer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaub%2Fas-buffer/lists"}