Skip to content

Conversation

@wantaekchoi
Copy link

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
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 the stream subsystem. 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
Copy link

codecov bot commented Oct 27, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.52%. Comparing base (3c8c1ef) to head (96adc98).
⚠️ Report is 8 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #60426      +/-   ##
==========================================
+ Coverage   88.07%   88.52%   +0.45%     
==========================================
  Files         704      702       -2     
  Lines      207778   207354     -424     
  Branches    39949    39895      -54     
==========================================
+ Hits       182998   183558     +560     
+ Misses      16791    15922     -869     
+ Partials     7989     7874     -115     
Files with missing lines Coverage Δ
lib/stream/consumers.js 100.00% <100.00%> (ø)

... and 118 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.

@wantaekchoi wantaekchoi force-pushed the add-stream-consumers-bytes branch 2 times, most recently from 3887f53 to 4117fc0 Compare October 27, 2025 21:41
- Add bytes() method to get Uint8Array from streams
- Add tests for bytes() method in PassThrough and ObjectMode scenarios
- Update documentation

Fixes: nodejs#59542
@wantaekchoi wantaekchoi force-pushed the add-stream-consumers-bytes branch from 4117fc0 to b6a5a18 Compare October 27, 2025 21:53
Co-authored-by: René <contact.9a5d6388@renegade334.me.uk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run. semver-minor PRs that contain new features and should be released in the next minor version. stream Issues and PRs related to the stream subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

node:stream/consumers should have a bytes method for getting a Uint8Array

4 participants