Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/proc/tests/deps/streams.ts>toText

A better way to work with processes in Deno.
Latest
function toText
Re-export
import { toText } from "https://deno.land/x/proc@0.21.9/tests/deps/streams.ts";

Converts a ReadableSteam of strings or Uint8Arrays to a single string. Works the same as Response.text.

Examples

Example 1

import { toText } from "https://deno.land/std@0.224.0/streams/to_text.ts";

const stream = ReadableStream.from(["Hello, ", "world!"]);
await toText(stream); // "Hello, world!"

Parameters

readableStream: ReadableStream

Returns

Promise<string>