Skip to content

stream: add bytes() method to stream/consumers - #60426

Merged
nodejs-github-bot merged 5 commits into
nodejs:mainfrom
wantaekchoi:add-stream-consumers-bytes
Jan 29, 2026
Merged

nodejs-github-bot merged 5 commits into
nodejs:mainfrom
wantaekchoi:add-stream-consumers-bytes

Conversation

@wantaekchoi

Copy link
Copy Markdown
Contributor

stream: add bytes() method to stream/consumers

Add a bytes() method to the stream/consumers module that returns a Uint8Array, providing a convenient way to consume streams as typed arrays.

Fixes: #59542

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/streams

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. stream Issues and PRs related to Node.js streams. labels Oct 27, 2025
@H4ad H4ad added the semver-minor PRs that contain new features and should be released in the next minor version. label Oct 27, 2025
@codecov

codecov Bot commented Oct 27, 2025 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.79%. Comparing base (4fe325d) to head (2cad010).
⚠️ Report is 631 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #60426      +/-   ##
==========================================
+ Coverage   88.58%   89.79%   +1.21%     
==========================================
  Files         704      673      -31     
  Lines      207823   203830    -3993     
  Branches    40049    39174     -875     
==========================================
- Hits       184101   183037    -1064     
+ Misses      15772    13140    -2632     
+ Partials     7950     7653     -297     
Files with missing lines Coverage Δ
lib/stream/consumers.js 100.00% <100.00%> (ø)

... and 256 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

- Add bytes() method to get Uint8Array from streams
- Add tests for bytes() method in PassThrough and ObjectMode scenarios
- Update documentation

Fixes: #59542