NodeOPCUA API Documentation
    Preparing search index...

    Type Alias NodesetSource

    NodesetSource:
        | string
        | Uint8Array
        | NodesetChunkStream
        | (() => NodesetChunkStream)
        | NamedNodesetSource

    a NodeSet2 document, as one of:

    • the whole document as a string or as UTF-8 bytes;
    • a stream of chunks; it is read once, from the start, so a stream that has already been partly consumed cannot be used;
    • a function opening such a stream, called once when the loader gets to it, so that a list of files does not hold every descriptor open from the start;
    • any of the above with a name, used in error messages, and optionally an imageKey.

    A byte-order mark at the start is dropped; a multi-byte character may straddle two chunks. Decompression is the caller's business and needs no library support:

    // Node.js
    { name: file, source: () => fs.createReadStream(file).pipe(zlib.createGunzip()) }
    // browser
    { name: url, source: async function* () { yield* (await fetch(url)).body!.pipeThrough(new DecompressionStream("gzip")); } }

    An array given to generateAddressSpaceRaw is always a list of documents; chunks of one document held in an array go through the named form: { name, source: chunks }.

    A source may hold a precompiled image instead of the XML; it is recognized by its first bytes and replayed, whether or not an image store is configured.