2.2.22 • Published 2 years ago

dslink v2.2.22

Weekly downloads
84
License
Apache-2.0
Repository
github
Last release
2 years ago

sdk-dslink-ts

JavaScript / Typescript SDK for the DSA protocol.

Version 2.0 of this sdk is re-written with typescript and is NOT backward compatible with the DSA javascript sdk 1.x.

Install

npm install dslink --save or yarn add dslink

Use Typescript

To compile with dslink sdk's typescript definition, make sure esModuleInterop flag is true in typescript compilerOptions.

Install DsLink on broker

You can zip a javascript dslink and install it on dglux-server.

A working example

Nodejs Example (responder)

A sample dslink with a basic value node at the path /value

const {DSLink, RootNode, ValueNode} = require("dslink");

class MyValueNode extends ValueNode {
  constructor(path, provider) {
    super(path, provider, 'myvalue', 'number');
    this._value = 123;
  }
}

function main() {
  let rootNode = new RootNode();
  rootNode.createChild('value', MyValueNode);

  let link = new DSLink('mydslink', {rootNode});
  link.connect();
}

main();

Browser Example (requester only)

const {DSLink} = require('dslink/js/web');

async function main() {
    let link = new DSLink('ws://localhost:8080/ws', 'json');
    link.connect();

    let {requester} = link;

    console.log(await requester.subscribeOnce('/sys/dataOutPerSecond'));
}

main();
2.2.22

2 years ago

2.2.21

2 years ago

2.2.19

2 years ago

2.2.18

2 years ago

2.2.14

3 years ago

2.2.13

3 years ago

2.2.12

3 years ago

2.2.11

3 years ago

2.2.10

3 years ago

2.2.9

3 years ago

2.2.7

3 years ago

2.2.3

4 years ago

2.2.2

4 years ago

2.1.19

4 years ago

2.1.18

4 years ago

2.1.17

4 years ago

2.1.15

4 years ago

2.1.14

4 years ago

2.1.10-beta.0

4 years ago

2.1.5

4 years ago

2.1.2

4 years ago

2.1.1

4 years ago

2.1.0-beta.0

5 years ago

2.0.4

5 years ago

2.0.3

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

2.0.0-alpha.2

5 years ago

2.0.0-alpha.1

5 years ago

2.0.0-alpha.0

5 years ago

1.2.1

7 years ago

1.1.1

8 years ago

1.2.0

8 years ago

1.1.0

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago