Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Sync alternative to `fs.openAsBlob`

オープン
#65,462 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
活発
技術スタック
javascript
領域
backend

調査の方向性

まず、既存の fs.openAsBlob API と fs.createReadStream API、およびそれらのドキュメントを確認します。エントリーポイントを提案する前に、同期 File API の形状、Response に公開されるメタデータ、ランタイム間の動作を明確にします。API 設計について合意され、その動作がテストとドキュメントでカバーされれば完了です。

索引モデルが issue の本文から書いたものです。

説明

feature request
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 suggestion made it to node:fs:

const getFile: (path: string) => File = globalThis.Bun
  ? Bun.file
  : process.getBuiltinModule('fs').openAsWebFile;

// Usage
return new Response(getFile('./index.html'));
return new Response(getFile('./binary-data').slice(0, 100));
What is the feature you are proposing to solve the problem?

A new API, something like fs.openAsWebFile() that returns a File maybe?
It would have more info for the Response constructor to pick up as well.

What alternatives have you considered?

fs.createReadStream but that is also async and can be slower too.

主要言語
JavaScript
スター
122k
フォーク
37.4k
平均マージ
4日 4時間
マージ済み PR(30日)
276

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

nodejs/node のほかの issue

nodejs/node の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。