Skip to main content
TextDecoder.prototype.decode - Node documentation
method TextDecoder.prototype.decode

Usage in Deno

import { TextDecoder } from "node:util";
TextDecoder.prototype.decode(
input?:
ArrayBufferView
| ArrayBuffer
| null
,
options?: { stream?: boolean | undefined; },
): string

Decodes the input and returns a string. If options.stream is true, any incomplete byte sequences occurring at the end of the input are buffered internally and emitted after the next call to textDecoder.decode().

If textDecoder.fatal is true, decoding errors that occur will result in aTypeError being thrown.

Parameters

optional
input:
ArrayBufferView
| ArrayBuffer
| null

An ArrayBuffer, DataView, or TypedArray instance containing the encoded data.

optional
options: { stream?: boolean | undefined; }

Return Type

string