{"id":17963290,"url":"https://github.com/borewit/readable-web-to-node-stream","last_synced_at":"2025-05-16T00:05:06.109Z","repository":{"id":38375522,"uuid":"184474666","full_name":"Borewit/readable-web-to-node-stream","owner":"Borewit","description":"Converts a Web-API ReadableStream into a Node stream.Readable","archived":false,"fork":false,"pushed_at":"2025-05-15T04:20:31.000Z","size":1284,"stargazers_count":44,"open_issues_count":6,"forks_count":8,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-16T00:04:54.171Z","etag":null,"topics":["adapter","converter","node","readable","readable-stream","stream","web"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/Borewit.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"Borewit","buy_me_a_coffee":"borewit"}},"created_at":"2019-05-01T20:06:00.000Z","updated_at":"2025-02-16T13:20:32.000Z","dependencies_parsed_at":"2025-03-11T05:10:43.130Z","dependency_job_id":"3abcf268-b542-4db5-b402-c33e82444898","html_url":"https://github.com/Borewit/readable-web-to-node-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/Borewit%2Freadable-web-to-node-stream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Borewit%2Freadable-web-to-node-stream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Borewit%2Freadable-web-to-node-stream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Borewit%2Freadable-web-to-node-stream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Borewit","download_url":"https://codeload.github.com/Borewit/readable-web-to-node-stream/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254442854,"owners_count":22071878,"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":["adapter","converter","node","readable","readable-stream","stream","web"],"created_at":"2024-10-29T11:25:08.538Z","updated_at":"2025-05-16T00:05:06.069Z","avatar_url":"https://github.com/Borewit.png","language":"TypeScript","readme":"[![Node.js CI](https://github.com/Borewit/readable-web-to-node-stream/actions/workflows/ci.yml/badge.svg)](https://github.com/Borewit/readable-web-to-node-stream/actions/workflows/ci.yml)\n[![NPM version](https://badge.fury.io/js/readable-web-to-node-stream.svg)](https://npmjs.org/package/readable-web-to-node-stream)\n[![npm downloads](http://img.shields.io/npm/dm/readable-web-to-node-stream.svg)](https://npmcharts.com/compare/readable-web-to-node-stream)\n[![Known Vulnerabilities](https://snyk.io/test/github/Borewit/readable-web-to-node-stream/badge.svg?targetFile=package.json)](https://snyk.io/test/github/Borewit/readable-web-to-node-stream?targetFile=package.json)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/d4b511481b3a4634b6ca5c0724407eb9)](https://www.codacy.com/gh/Borewit/peek-readable/dashboard?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=Borewit/peek-readable\u0026amp;utm_campaign=Badge_Grade)\n[![Coverage Status](https://coveralls.io/repos/github/Borewit/readable-web-to-node-stream/badge.svg?branch=master)](https://coveralls.io/github/Borewit/readable-web-to-node-stream?branch=master)\n\n# readable-web-to-node-stream\n\nConverts a [Web-API readable stream](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader) into a [Node.js readable stream](https://nodejs.org/api/stream.html#stream_readable_streams).\n\nTo covert the other way around, from [Node.js readable stream](https://nodejs.org/api/stream.html#stream_readable_streams) to [Web-API readable stream](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader), \nyou may use [node-readable-to-web-readable-stream](https://github.com/Borewit/node-readable-to-web-readable-stream).\n\n## Installation\nInstall via [npm](http://npmjs.org/):\n\n```bash\nnpm install readable-web-to-node-stream\n```\nor [yarn](https://yarnpkg.com/):\n```bash\nyarn add readable-web-to-node-stream\n```\n\n## Compatibility\n\nVersion 4 migrated from CommonJS (CJS) to a pure ECMAScript module (ESM).\nThe ESM has a _Node_ and a _default_ entry point.\nSource is written in TypeScript and compiled to [ECMAScript ES2020 (ES11)](https://en.wikipedia.org/wiki/ECMAScript_version_history#11th_Edition_%E2%80%93_ECMAScript_2020).\nThe _Node_ entry requires a [Node.js ≥ 18](https://nodejs.org/en/about/previous-releases) engine.\n\n## Usage\n\nExample, import readable-web-stream-to-node in JavaScript:\n```js\nimport { ReadableWebToNodeStream } from 'readable-web-to-node-stream';\n\nasync function download(url) {\n    const response = await fetch(url);\n    const readableWebStream = response.body;\n    const nodeStream = new ReadableWebToNodeStream(readableWebStream);\n}\n```\n\nFor  [Node.js ≥ 22](https://nodejs.org/en/about/previous-releases), should also work in a CommonJS projects:\n```js\nconst {ReadableWebToNodeStream} = require('readable-web-to-node-stream');\n\nasync function download(url) {\n    const response = await fetch(url);\n    const readableWebStream = response.body;\n    const nodeStream = new ReadableWebToNodeStream(readableWebStream);\n}\n```\n\nFor TypeScript / CommonJS projects, not using Node.js ≥ 22, check [load-esm](https://github.com/Borewit/load-esm).\n\n## API\n\n**constructor(stream: ReadableStream, options): Promise\u003cvoid\u003e**\n\n- `stream: ReadableStream`: the [Web-API readable stream](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader).\n- `options?: {propagateDestroy: boolean}`\n  - `propagateDestroy`, default value is `false`, if set to `true`, will also cancel the _stream_ when the Node.js Readable is destroyed. \n\n## Licence\n\n(The MIT License)\n\nCopyright (c) 2025 Borewit\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","funding_links":["https://github.com/sponsors/Borewit","https://buymeacoffee.com/borewit"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborewit%2Freadable-web-to-node-stream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fborewit%2Freadable-web-to-node-stream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborewit%2Freadable-web-to-node-stream/lists"}