fs: document readStream.start and readStream.end

オープン 初心者向け
#67,848 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@IMRANDIL がすでに取り組んでいます。

2026年11月29日 から。

  • #67870 @IMRANDIL による — オープン

評価

難易度
1/5
見積もり時間
1時間未満
初心者へのやさしさ
90/100
issue の種類
ドキュメント
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
javascript, node.js
領域
documentation

調査の方向性

fs.ReadStream と fs.createReadStream() の API ドキュメントを探してください。既存の readStream.start と readStream.end プロパティを、読み取り専用として、その数値/undefined および Infinity の値を含めて文書化してください。完了とは、実行時の動作を変更せずに、範囲プロパティが明確に説明されていることを意味します。

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

説明

doc
What is the problem this feature will solve?

When a library is given an fs.ReadStream, it can do much better by reading the file directly than by consuming the stream. For example, a tar lister can seek over file bodies instead of reading them. On a 100 MiB archive of 4 files, that is 11 ms instead of 91 ms. Doing this is only correct if the stream has not been read yet, and if it covers the whole file.

readStream.path, readStream.bytesRead and readStream.pending are documented. The range the stream was created with is not. It is available as the undocumented readStream.start and readStream.end properties (end is Infinity by default).

What is the feature you are proposing to solve the problem?

Document readStream.start and readStream.end as read-only properties: the byte range given to fs.createReadStream() (start is undefined or a number, and end is Infinity by default).

What alternatives have you considered?
  • Asking the caller to pass a path instead of a stream: it is not always the caller's choice.
  • Reading the undocumented properties, which works today but has no guarantee.
主要言語
JavaScript
スター
124k
フォーク
38k
平均マージ
4日 2時間
マージ済み PR(30日)
266

環境構築

はじめの一歩

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

nodejs/node のほかの issue

nodejs/node の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

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

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