Revise backpressure examples in streams documentation#90
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryLow Risk Overview Removes the narrative that Reviewed by Cursor Bugbot for commit e094691. Bugbot is set up for automated code reviews on this repo. Configure here. |
👋 Codeowner Review RequestThe following codeowners have been identified for the changed files: Team reviewers: @nodejs/streams Please review the changes when you have a chance. Thank you! 🙏 |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates the backpressure module to better illustrate memory/throughput implications of buffering vs streaming in Node.js compression examples.
Changes:
- Replaces the
zip(1)example withfs.readFileSync+zlib.gzipSyncexamples (CJS + ESM). - Adds an explicit “streams without backpressure” example plus an explanation of why it can OOM.
- Removes the prior note about comparing resulting archives.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| inp.on('data', (chunk) => gzip.write(chunk)); | ||
| inp.on('end', () => gzip.end()); | ||
| gzip.on('data', (chunk) => out.write(chunk)); | ||
| gzip.on('end', () => out.end()); |
|
Bump @baskakov |
Discussed here: https://stackoverflow.com/questions/79821132/node-js-back-pressure-documentation-whats-the-relevance-of-their-example Original backpressure example contains following oddities: 1) Incorrect zip example 2) Incorrect assumption that zip console command loads full file into memory. Updated examples to demonstrate file compression using Node.js streams with backpressure handling. Signed-off-by: Dmitry Baskakov <dmitry@bask.ws>
|
@avivkeller Thanks! Done. Rebased changes in a single commit |
Discussed here: https://stackoverflow.com/questions/79821132/node-js-back-pressure-documentation-whats-the-relevance-of-their-example Original backpressure example contains following oddities: 1) Incorrect zip example 2) Incorrect assumption that zip console command loads full file into memory. Updated examples to demonstrate file compression using Node.js streams with backpressure handling.