Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@node-wot/td-tools

Package Overview
Dependencies
Maintainers
4
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@node-wot/td-tools

W3C Web of Things (WoT) Thing Description parser, serializer, and other tools

  • 0.8.9
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
87
decreased by-7.45%
Maintainers
4
Weekly downloads
 
Created
Source

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.

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
TDTools = require("@node-wot/td-tools");
Thing = require("@node-wot/td-tools").Thing;


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


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

More Details

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

FAQs

Package last updated on 13 Oct 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc