Title: Sync alternative to `fs.openAsBlob` · Issue #65462 · nodejs/node · GitHub
Open Graph Title: Sync alternative to `fs.openAsBlob` · Issue #65462 · nodejs/node
X Title: Sync alternative to `fs.openAsBlob` · Issue #65462 · nodejs/node
Description: What is the problem this feature will solve? I'm making a cross-runtime file streaming library (that needs to be fast) and this would make it way easier to do so since Bun.file() is already sync. So the code might look like this if my su...
Open Graph Description: What is the problem this feature will solve? I'm making a cross-runtime file streaming library (that needs to be fast) and this would make it way easier to do so since Bun.file() is already sync. S...
X Description: What is the problem this feature will solve? I'm making a cross-runtime file streaming library (that needs to be fast) and this would make it way easier to do so since Bun.file() is already syn...
Opengraph URL: https://github.com/nodejs/node/issues/65462
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Sync alternative to `fs.openAsBlob`","articleBody":"### What is the problem this feature will solve?\n\nI'm making a cross-runtime file streaming library (that needs to be fast) and this would make it way easier to do so since `Bun.file()` is already sync.\n\nSo the code might look like this if my suggestion made it to `node:fs`:\n```ts\nconst getFile: (path: string) => File = globalThis.Bun\n ? Bun.file\n : process.getBuiltinModule('fs').openAsWebFile;\n\n// Usage\nreturn new Response(getFile('./index.html'));\nreturn new Response(getFile('./binary-data').slice(0, 100));\n```\n\n### What is the feature you are proposing to solve the problem?\n\nA new API, something like `fs.openAsWebFile()` that returns a `File` maybe?\nIt would have more info for the `Response` constructor to pick up as well.\n\n### What alternatives have you considered?\n\n`fs.createReadStream` but that is also async and can be slower too.","author":{"url":"https://github.com/aquapi","@type":"Person","name":"aquapi"},"datePublished":"2026-08-21T17:12:43Z","url":"https://github.com/nodejs/node/issues/65462"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:cf6e413f-071d-1a83-4669-47056c01a8dc |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C734:143C91:723E4C:983430:6AED2233 |
| html-safe-nonce | a57d2c88116889209096c389ccc597c6a71a93b0878f80c2e17dbfd2d9843062 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNzM0OjE0M0M5MTo3MjNFNEM6OTgzNDMwOjZBRUQyMjMzIiwidmlzaXRvcl9pZCI6IjgwNjU1MTQzODM5NjMxMzY1NjMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | ccfc52c1f718628c246c6a906ec9e4a702f2bd25edf22fe43d4b594757c020b3 |
| hovercard-subject-tag | issue:5216464168 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/65462/issue_layout |
| twitter:image | https://opengraph.githubassets.com/cb9d63194af5922845c7fd271f12b6c635c93d6be2e3340fdfa8cf41d10c5e35/nodejs/node/issues/65462 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/cb9d63194af5922845c7fd271f12b6c635c93d6be2e3340fdfa8cf41d10c5e35/nodejs/node/issues/65462 |
| og:image:alt | What is the problem this feature will solve? I'm making a cross-runtime file streaming library (that needs to be fast) and this would make it way easier to do so since Bun.file() is already sync. S... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | aquapi |
| hostname | github.com |
| expected-hostname | github.com |
| None | e3e0f7f63e50c6fe879198a93a0a023a648ecc0a5e9bc3b5e033ac57172237e6 |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 707a24b346ac8a82878b9c084efaa38a997660cb |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width