Skip to content

Commit

Permalink
feat: add readme's for td-tools and core
Browse files Browse the repository at this point in the history
  • Loading branch information
danielpeintner committed Feb 10, 2020
1 parent e478b1f commit 400e611
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 0 deletions.
22 changes: 22 additions & 0 deletions packages/core/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Core of node-wot

The `core` of node-wot is the entry point allowing to attach dedicated bindings such as:
* [HTTP](https://github.com/eclipse/thingweb.node-wot/blob/master/packages/binding-http)
* [CoAP](https://github.com/eclipse/thingweb.node-wot/blob/master/packages/binding-coap)
* ...

or to create user-specific bindings.

### Prerequisites
* `npm install @node-wot/core`


### Examples

see binding examples such as
* https://github.com/eclipse/thingweb.node-wot/blob/master/packages/binding-http
* https://github.com/eclipse/thingweb.node-wot/blob/master/packages/binding-coap

### More Details

see https://github.com/eclipse/thingweb.node-wot/
52 changes: 52 additions & 0 deletions packages/td-tools/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# TD (ThingDescription) tools of node-wot

## 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 = "[email protected]"
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/

0 comments on commit 400e611

Please sign in to comment.