Documentation
    Preparing search index...

    Class MUtf8DecoderStream

    The streaming equivalent of MUtf8Decoder.

    This transform stream provides efficient decoding of Modified UTF-8 data in streaming scenarios, allowing you to process large amounts of data without loading everything into memory.

    import { MUtf8DecoderStream } from 'mutf-8-stream';

    await binaryStream
    .pipeThrough(new MUtf8DecoderStream())
    .pipeTo(new WritableStream({
    write(textChunk) {
    console.log('Decoded text:', textChunk);
    }
    }));

    v1.2.0

    Hierarchy

    Index

    Constructors

    Properties

    Accessors

    Constructors

    Properties

    readable: ReadableStream<string>
    writable: WritableStream<AllowSharedBufferSource>

    Accessors

    • get encoding(): string

      The encoding name for this decoder.

      This property is provided for compatibility with the WHATWG TextDecoderStream interface.

      Returns string

      Always "mutf-8"

    • get fatal(): boolean

      Indicates whether the decoder is in fatal error mode.

      When true, the decoder will throw a TypeError when encountering invalid Modified UTF-8 byte sequences. When false, invalid sequences are replaced with the Unicode replacement character (U+FFFD).

      Returns boolean

      true if error mode is fatal, otherwise false

    • get ignoreBOM(): boolean

      Indicates whether the decoder ignores Byte Order Marks.

      When true, BOM bytes (0xEF 0xBB 0xBF) at the beginning of input are silently ignored. When false, they are treated as regular characters.

      Returns boolean

      true if BOM should be ignored, otherwise false