fs: document readStream.start and readStream.end

Aperta Adatta ai principianti
#67,848 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@IMRANDIL ci sta già lavorando.

Dal 29/11/2026.

  • #67870 di @IMRANDIL — aperta

Valutazione

Difficoltà
1/5
Tempo stimato
Meno di un'ora
Idoneità per principianti
90/100
Tipo di issue
Documentazione
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
javascript, node.js
Ambito
documentation

Direzione di ricerca

Trova la documentazione dell’API per fs.ReadStream e fs.createReadStream(). Documenta le proprietà esistenti readStream.start e readStream.end come di sola lettura, inclusi i loro valori numerici/undefined e Infinity; completare significa che le proprietà dell’intervallo sono descritte chiaramente senza modificare il comportamento durante l’esecuzione.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.
Lingua principale
JavaScript
Stelle
124k
Fork
38k
Merge medio
4g 2h
PR unite (30g)
266

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di nodejs/node

Tutte le issue di nodejs/node

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.