From 55f48446c72fdc10043eb733a19aecc7928da543 Mon Sep 17 00:00:00 2001 From: Khafra Date: Mon, 22 Jun 2026 19:40:44 -0400 Subject: [PATCH] buffer: implement blob.textStream() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Matthew Aitken PR-URL: https://github.com/nodejs/node/pull/64036 Refs: https://github.com/w3c/FileAPI/commit/cd1d1da9a5375af0622af4b36e76c6e6bd9d130b Refs: https://github.com/nodejs/undici/commit/0d6ecc571095a6bff1c2ad4ee43dd6ae4e97411c Reviewed-By: René Reviewed-By: Matteo Collina Reviewed-By: Gürgün Dayıoğlu Reviewed-By: Luigi Pinca Reviewed-By: Mattias Buelens --- doc/api/buffer.md | 14 ++++++++++++++ lib/internal/blob.js | 20 ++++++++++++++++++++ test/parallel/test-blob.js | 21 ++++++++++++++++++++- 3 files changed, 54 insertions(+), 1 deletion(-) diff --git a/doc/api/buffer.md b/doc/api/buffer.md index a9f9a148fdc..4ffd229cefa 100644 --- a/doc/api/buffer.md +++ b/doc/api/buffer.md @@ -593,6 +593,18 @@ added: Returns a promise that fulfills with the contents of the `Blob` decoded as a UTF-8 string. +### `blob.textStream()` + + + +* Returns: {ReadableStream} + +Returns a new `ReadableStream` that allows the content of the `Blob` to be read +as a stream of UTF-8 decoded strings. It is equivalent to piping +[`blob.stream()`][] through a [`TextDecoderStream`][] set up with UTF-8. + ### `blob.type`