nx.js
Classes

TextEncoder

TextEncoder takes a UTF-8 encoded string of code points as input and return a stream of bytes.

See https://developer.mozilla.org/docs/Web/API/TextEncoder

Implements

Constructors

new TextEncoder()

new TextEncoder(): TextEncoder

Returns

TextEncoder

Properties

PropertyTypeDescription
encodingstringReturns "utf-8". MDN Reference

Methods

encode()

encode(input?): Uint8Array

Returns the result of running UTF-8's encoder.

See https://developer.mozilla.org/docs/Web/API/TextEncoder/encode

Parameters

ParameterType
input?string

Returns

Uint8Array

Implementation of

globalThis.TextEncoder.encode


encodeInto()

encodeInto(input, destination): TextEncoderEncodeIntoResult

Runs the UTF-8 encoder on source, stores the result of that operation into destination, and returns the progress made as an object wherein read is the number of converted code units of source and written is the number of bytes modified in destination.

Note: Not currently supported.

See https://developer.mozilla.org/docs/Web/API/TextEncoder/encodeInto

Parameters

ParameterType
inputstring
destinationUint8Array

Returns

TextEncoderEncodeIntoResult

Implementation of

globalThis.TextEncoder.encodeInto

On this page