JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 24
  • Score
    100M100P100Q58674F
  • License MIT

WAGO - WDX - WS - Client - JavaScript

Package Exports

  • @wago/wdx-ws-client-js
  • @wago/wdx-ws-client-js/build/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@wago/wdx-ws-client-js) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

WDX - WS - Client - JS

A TypeScript Web Socket Library providing services for Managing WDX instance.

Table of Contents

Installation

To install the library, use npm or yarn:

npm install @wago/wdx-ws-client-js

or

yarn add @wago/wdx-ws-client-js

Usage

Using Client

Here's an example:

const WDXWSClient = require('@wago/wdx-ws-client-js');

(async () => {
    try {
        const c = new WDXWSClient.WDX.WS.Client.JS.Service.ClientService(
            { protocol: 'ws', host: 'localhost', port: 82 }
        );
        await c.connect();

        console.log('Connected successfully');

        const path = 'Virtual.virtual-store.test';

        c.dataService.getSchema(path, 1).subscribe(
            {
                next: (schema) => {
                    console.log(JSON.stringify(schema, null, 2));
                },

                error: async (error) => {
                    console.error('Error: ' + error.message);

                    await c.disconnect();
                    console.log('Disconnected successfully');
                },

                complete: async () => {
                    await c.disconnect();
                    console.log('Disconnected successfully');
                }
            },
        );

    } catch (e) {
        console.error('Error: ' + e.message);
        console.error('Error: ' + e.stack);
    }
})();

For more examples, see github repository example directory.

License

This library is licensed under the MIT License. See the LICENSE.md file for more details.

© 2024

This README.md provides a clear introduction to the TypeScript model schema library, with examples of how to use it, and includes the required copyright and licensing information under the MIT License.