Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/proc/src/transformers.ts>toText

A high-level way to run child processes that is easy, flexible, powerful, and prevents resource leaks.
Go to Latest
function toText
import { toText } from "https://deno.land/x/proc@0.20.22/src/transformers.ts";

Convert Uint8Array to text. The text is not split into lines, so it will contain lf and cr in arbitrary places. Conversion is done as data is received, so this is good for passing stderr and/or stdout data that shows progress (only cr or other positioning codes).

Wraps TextDecoderStream.

Parameters

optional
label = [UNSUPPORTED]

Any valid encoding. Default is "utf-8". See Encoding API Encodings.

Returns

(chunks: AsyncIterable<Uint8Array>) => AsyncIterable<string>

A transformer.