stream: add bytes() method to stream/consumers#60426
Merged
nodejs-github-bot merged 5 commits intonodejs:mainfrom Jan 29, 2026
Merged
stream: add bytes() method to stream/consumers#60426nodejs-github-bot merged 5 commits intonodejs:mainfrom
nodejs-github-bot merged 5 commits intonodejs:mainfrom
Conversation
Collaborator
|
Review requested:
|
Codecov Report✅ All modified and coverable lines are covered by tests. 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
🚀 New features to boost your workflow:
|
3887f53 to
4117fc0
Compare
- Add bytes() method to get Uint8Array from streams - Add tests for bytes() method in PassThrough and ObjectMode scenarios - Update documentation Fixes: nodejs#59542
4117fc0 to
b6a5a18
Compare
Renegade334
reviewed
Oct 30, 2025
Co-authored-by: René <[email protected]>
Contributor
Ethan-Arrowood
left a comment
There was a problem hiding this comment.
This LGTM but I'm not explicitly approving it. I don't know why we really need this when user's could do new Uint8Array(await arrayBuffer(stream)); themselves (or rather any conversion from the raw ArrayBuffer).
Contributor
|
Looking at the issue, I see this is meant to align us with the new I'm okay with that then :) nice work! |
Ethan-Arrowood
approved these changes
Nov 3, 2025
Renegade334
reviewed
Nov 3, 2025
Co-authored-by: jakecastelli <[email protected]>
Renegade334
approved these changes
Nov 29, 2025
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
jakecastelli
approved these changes
Nov 30, 2025
MattiasBuelens
approved these changes
Nov 30, 2025
This comment was marked as outdated.
This comment was marked as outdated.
benjamingr
approved these changes
Dec 20, 2025
This comment was marked as outdated.
This comment was marked as outdated.
Renegade334
reviewed
Jan 28, 2026
jakecastelli
approved these changes
Jan 29, 2026
This comment has been minimized.
This comment has been minimized.
Collaborator
Collaborator
|
Landed in 938f175 |
aduh95
pushed a commit
that referenced
this pull request
Feb 2, 2026
- Add bytes() method to get Uint8Array from streams - Add tests for bytes() method in PassThrough and ObjectMode scenarios - Update documentation Fixes: #59542 PR-URL: #60426 Reviewed-By: Ethan Arrowood <[email protected]> Reviewed-By: René <[email protected]> Reviewed-By: Jake Yuesong Li <[email protected]> Reviewed-By: Mattias Buelens <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Gürgün Dayıoğlu <[email protected]>
nodejs-github-bot
added a commit
that referenced
this pull request
Feb 2, 2026
Notable changes: async_hooks: * (SEMVER-MINOR) add trackPromises option to createHook() (Joyee Cheung) #61415 src: * improve textEncoder encode performance with simdutf (Mert Can Altin) #61496 stream: * (SEMVER-MINOR) add bytes() method to stream/consumers (wantaek) #60426 test_runner: * (SEMVER-MINOR) add env option to run function (Ethan Arrowood) #61367 url: * update ada to v3.4.2 and support unicode 17 (Yagiz Nizipli) #61593 PR-URL: #61635
aduh95
pushed a commit
that referenced
this pull request
Feb 2, 2026
- Add bytes() method to get Uint8Array from streams - Add tests for bytes() method in PassThrough and ObjectMode scenarios - Update documentation Fixes: #59542 PR-URL: #60426 Reviewed-By: Ethan Arrowood <[email protected]> Reviewed-By: René <[email protected]> Reviewed-By: Jake Yuesong Li <[email protected]> Reviewed-By: Mattias Buelens <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Gürgün Dayıoğlu <[email protected]>
aduh95
added a commit
that referenced
this pull request
Feb 2, 2026
Notable changes: async_hooks: * (SEMVER-MINOR) add `trackPromises` option to `createHook()` (Joyee Cheung) #61415 net: * (SEMVER-MINOR) add `setTOS` and `getTOS` to `Socket` (Amol Yadav) #61503 src: * (SEMVER-MINOR) add initial support for ESM in embedder API (Joyee Cheung) #61548 * improve `TextEncoder` encode performance with `simdutf` (Mert Can Altin) #61496 stream: * (SEMVER-MINOR) add `bytes()` method to `node:stream/consumers` (wantaek) #60426 test_runner: * (SEMVER-MINOR) add `env` option to `run` function (Ethan Arrowood) #61367 url: * update Ada to v3.4.2 and support Unicode 17 (Yagiz Nizipli) #61593 PR-URL: #61635
aduh95
added a commit
that referenced
this pull request
Feb 2, 2026
Notable changes: async_hooks: * (SEMVER-MINOR) add `trackPromises` option to `createHook()` (Joyee Cheung) #61415 net: * (SEMVER-MINOR) add `setTOS` and `getTOS` to `Socket` (Amol Yadav) #61503 src: * (SEMVER-MINOR) add initial support for ESM in embedder API (Joyee Cheung) #61548 * improve `TextEncoder` encode performance with `simdutf` (Mert Can Altin) #61496 stream: * (SEMVER-MINOR) add `bytes()` method to `node:stream/consumers` (wantaek) #60426 test_runner: * (SEMVER-MINOR) add `env` option to `run` function (Ethan Arrowood) #61367 url: * update Ada to v3.4.2 and support Unicode 17 (Yagiz Nizipli) #61593 PR-URL: #61635
aduh95
added a commit
that referenced
this pull request
Feb 3, 2026
Notable changes: async_hooks: * (SEMVER-MINOR) add `trackPromises` option to `createHook()` (Joyee Cheung) #61415 net: * (SEMVER-MINOR) add `setTOS` and `getTOS` to `Socket` (Amol Yadav) #61503 src: * (SEMVER-MINOR) add initial support for ESM in embedder API (Joyee Cheung) #61548 * improve `TextEncoder` encode performance with `simdutf` (Mert Can Altin) #61496 stream: * (SEMVER-MINOR) add `bytes()` method to `node:stream/consumers` (wantaek) #60426 test_runner: * (SEMVER-MINOR) add `env` option to `run` function (Ethan Arrowood) #61367 url: * update Ada to v3.4.2 and support Unicode 17 (Yagiz Nizipli) #61593 PR-URL: #61635
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
stream: add bytes() method to stream/consumers
Add a
bytes()method to thestream/consumersmodule that returns a Uint8Array, providing a convenient way to consume streams as typed arrays.Fixes: #59542