NodeOPCUA API Documentation
    Preparing search index...

    Interface NodesetDocument

    a document handed to a format, in whichever shape that format finds convenient. Every accessor inflates first when the document was gzipped, and the results are computed once and shared, so a format that asks for both the lines and the bytes pays for one inflate.

    interface NodesetDocument {
        name: string;
        bytes(): Promise<Uint8Array<ArrayBufferLike>>;
        chunks(): AsyncIterable<NodesetChunk>;
        digest(): string | undefined;
        lines(): Promise<string[]>;
        rawBytes(): Promise<Uint8Array<ArrayBufferLike>>;
        readHead(complete: (text: string) => boolean): Promise<string>;
        text(): Promise<string>;
    }
    Index
    name: string
    • the whole document, inflated

      Returns Promise<Uint8Array<ArrayBufferLike>>

    • the document as it arrives, for a format that parses incrementally rather than whole

      Returns AsyncIterable<NodesetChunk>

    • the SHA-256 of the bytes as they arrived, when the loader was asked to compute one

      Returns string | undefined

    • the document's lines, for the line-delimited formats

      Returns Promise<string[]>

    • the bytes exactly as they arrived, still compressed if they were

      Returns Promise<Uint8Array<ArrayBufferLike>>

    • read from the start until complete(text) holds, or the document ends. What was read stays in the document and is delivered again, first, by NodesetDocument.chunks, so a format that reads a header this way has not spent the source.

      This is how a format avoids reading a body it does not need: the XML header pre-pass stops after a few hundred bytes of a four megabyte file.

      Parameters

      • complete: (text: string) => boolean

      Returns Promise<string>

    • the whole document as text, inflated and decoded

      Returns Promise<string>