Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Revise backpressure examples in streams documentation

Đang mở
#94 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
45/100
Loại issue
Tài liệu
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
javascript, node.js
Lĩnh vực
documentation

Hướng nghiên cứu

Bắt đầu bằng cách xem lại tài liệu hiện tại về streams và backpressure cùng ví dụ nén của tài liệu, sau đó xem cuộc thảo luận và pull request 90 được tham chiếu để có thêm ngữ cảnh. Công việc được xem là hoàn tất khi tài liệu đối chiếu các API buffering và streaming của Node.js, bao gồm các ví dụ về CommonJS và ESM, giải thích backpressure bị bỏ qua và các hệ quả đối với bộ nhớ, đồng thời xóa ghi chú so sánh các archive.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Problem

The current backpressure documentation contains examples that may be confusing or technically inaccurate.

Specifically:

The compression example uses the zip command in a way that does not clearly demonstrate the role of Node.js stream backpressure.
It implies that using a command-line compression utility loads the entire file into memory, which is generally not true and depends on the implementation.
The example focuses on comparing archive outputs rather than illustrating the memory and throughput implications of buffering versus streaming.

See discussion: https://stackoverflow.com/questions/79821132/node-js-back-pressure-documentation-whats-the-relevance-of-their-example

Proposed Solution

Update the examples to use Node.js APIs directly:

Replace the current zip example with fs.readFileSync() + zlib.gzipSync() examples (CommonJS and ESM variants) to demonstrate a buffering approach.
Add a corresponding streaming example using Node.js streams and zlib.createGzip().
Include an explicit example showing a stream implementation that ignores backpressure and explain why it can lead to excessive memory consumption or out-of-memory conditions.
Remove the note about comparing the resulting archives, as it does not help explain backpressure behavior.

Motivation

The primary goal of the backpressure documentation should be to help readers understand how streams regulate data flow and memory usage. Using examples based entirely on Node.js APIs makes the comparison clearer

https://github.com/nodejs/learn/pull/90

Ngôn ngữ chính
JavaScript
Star
29
Fork
165
Merge trung bình
1 ngày 18 giờ
Pull request đã merge (30 ngày)
2

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của nodejs/learn

Tất cả issue của nodejs/learn

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.