@sterfive/crawler

This nodejs modules extends node-opcua client with hightly optimized OPC UA address space crawler capabilities.

It allows you to crawl the address space of an OPC UA server using a drill down technic and perform global operation on all nodes.

It can be used to extract efficiently a sub-address space from a OPC UA server, and comes with advanced options to perform complex optimum tree browsing on the server.`

pre-requisite

this module relies on the @sterfive/node-opcua-optimized-client module.

Features

  • Efficient Address Space Crawling: Quickly and thoroughly explore the OPC UA address space, even for large and complex servers.
  • Drill-Down Technique: Intelligently navigate the server's hierarchy to discover all relevant nodes and their relationships.
  • Global Operations: Perform actions on multiple nodes simultaneously, such as reading values, subscribing to data changes, or writing data.
  • Sub-Address Space Extraction: Easily extract specific portions of the address space for analysis, migration, or replication.
  • Optimized Tree Browsing: Advanced algorithms ensure efficient browsing, minimizing network traffic and server load.
  • Integration with node-opcua: Built on top of the robust node-opcua stack, ensuring compatibility and reliability.

Use Cases

  • Data Discovery: Automatically discover all available data points and their properties on an OPC UA server.
  • Configuration Management: Extract and manage server configurations, including variable definitions, methods, and object structures.
  • System Integration: Facilitate the integration of OPC UA servers with other systems by providing a structured view of their address space.
  • Data Archiving: Efficiently collect data from specific parts of the address space for historical logging and analysis.
  • Security Auditing: Identify all accessible nodes and their permissions for security assessments.

Why Choose @sterfive/crawler?

  • Performance: Designed for speed and efficiency, allowing you to crawl large address spaces in a fraction of the time.
  • Reliability: Built on the battle-tested node-opcua library, ensuring stable and consistent operation.
  • Flexibility: Highly configurable to meet your specific crawling needs, from simple browsing to complex data extraction.
  • Ease of Use: Simple API that integrates seamlessly with your existing node-opcua client applications.
  • Expert Support: Backed by Sterfive, the creators and main maintainers of node-opcua, providing professional support and expertise.

Installation

$ npm install @sterfive/crawler

Example

import { NodeCrawler2, NodeCrawlerBase } from "@sterfive/crawler";

await client.withSessionAsync(endpointUrl, async (session) => {
    // create a new crawler
    const crawler = new NodeCrawler2(session);

    const data = {
        onBrowse: NodeCrawlerBase.follow,
    };

    crawler
        .on("browsed", (nodeElement, data) => {
            debugLog(" Node => ", nodeElement.browseName.toString(), nodeElement.nodeId.toString());

            // do something with the nodeElement
            // make sure the function returns as soon as possible
            myDumpReferences(nodeElement.references);
        })
        .on("end", function () {
            debugLog("Data ", data);
        })
        .on("error", function (err) {});

    // start the crawler
    await crawler.crawl(nodeToCrawl, data);

    // dispose the crawler when no longer needed
    crawler.dispose();
});