@node-wot/td-tools
TypeScript icon, indicating that this package has built-in type declarations

0.8.16 • Public • Published

[!WARNING] > @node-wot/td-tools package will be removed in the future. Please use @node-wot/core / @thingweb/thing-model / @thingweb/td-utils package instead.

TD (Thing Description) tools of node-wot

Current Maintainer(s): @danielpeintner @relu91

Getting Started

In the following example it is shown how td-tools of node-wot can be used.

Note: Some additional tooling (e.g., AAS AID, TD to AsyncAPI Converter) can be found in its own repository (see https://github.com/eclipse-thingweb/td-tools).

Prerequisites

  • npm install @node-wot/td-tools

Example

The example parses a TD and also serializes yet another newly created TD.

node example.js

// example.js
const TDTools = require("@node-wot/td-tools");
const { Thing } = require("@node-wot/td-tools");

// parse TD
const tdString = JSON.stringify({
    id : "123",
    title: "MyThing"
});
const dd = TDTools.parseTD(tdString);
console.log("**** PARSED TD ****");
console.log(dd);
console.log("****");


// init Thing and serialize to TD
const thing = new Thing();
thing.id = "789";
thing["@type"] = "Thing";
thing.support = "foo@example.com"
thing.properties = {
    "myProp" : {
        type: "integer"
    }
}
const tdString2 = TDTools.serializeTD(thing);
console.log("**** SERIALIZED TD ****");
console.log(tdString2);
console.log("****");

More Details

See https://github.com/eclipse-thingweb/node-wot/

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.8.167latest

Version History

VersionDownloads (Last 7 Days)Published
0.8.167
0.8.150
0.8.1435
0.8.130
0.8.1226
0.8.110
0.8.100
0.8.90
0.8.81
0.8.74
0.8.63
0.8.50
0.8.41
0.8.30
0.8.20
0.8.15
0.8.07
0.7.81
0.7.70
0.7.60
0.7.50
0.7.43
0.7.31
0.7.20
0.7.10
0.7.00
0.7.0-SNAPSHOT.60
0.7.0-SNAPSHOT.50
0.7.0-SNAPSHOT.40
0.7.0-SNAPSHOT.30
0.7.0-SNAPSHOT.20
0.6.3-SNAPSHOT.20
0.7.0-SNAPSHOT.10
0.6.22
0.6.2-SNAPSHOT.10
0.6.11
0.6.00
0.5.10
0.5.01
0.4.00
0.3.00
0.3.0-RC.10

Package Sidebar

Install

npm i @node-wot/td-tools

Weekly Downloads

98

Version

0.8.16

License

EPL-2.0 OR W3C-20150513

Unpacked Size

128 kB

Total Files

27

Last publish

Collaborators

  • jkrhb
  • cristiano.aguzzi
  • egeko
  • mkovatsc
  • danielpeintner
  • sebastiankb
  • h0ru5