import { text } from 'node:stream/consumers';
import { Readable } from 'node:stream';
const readable = Readable.from('Hello world from consumers!');
const data = await text(readable);
console.log(`from readable: ${data.length}`);
// Prints: from readable: 27
function
stream.consumers.text
): Promise<string>;
@returns
Fulfills with the contents of the stream parsed as a UTF-8 encoded string.