You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+35-14Lines changed: 35 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -56,13 +56,9 @@ For further information please refer to the official [W3C Web of Things](https:/
56
56
57
57
## Installation
58
58
59
-
The framework can be used in two ways: as a library or as a CLI tool. In this section we will explain how to installthe framework in both ways.
59
+
The framework is composed by different packages that users can use as they please. The core package is @node-wot/core and it is the only mandatory package to install. The other packages are bindings that allow the framework to communicate with different protocols.
60
60
61
-
### As a library
62
-
63
-
The framework is composed by different packages that users can use as they please. The core package is `@node-wot/core` and it is the only mandatory package to install. The other packages are bindings that allow the framework to communicate with different protocols.
64
-
65
-
#### Node.js
61
+
### Prerequisite: Node.js with build tools
66
62
67
63
> [!WARNING]
68
64
> We no longer actively support Node.js version 18 and lower.
@@ -81,27 +77,52 @@ Platforms specific prerequisites:
81
77
- Mac OS: Meet the [node-gyp](https://github.com/nodejs/node-gyp#installation) requirements:
82
78
-`xcode-select --install`
83
79
84
-
If you want to use node-wot as a library in your Node.js application, you can use npm to install the node-wot packages that you need. To do so, `cd` inside your application folder, and run:
80
+
### As a library
81
+
82
+
If you want to use node-wot as a library in your Node.js application, you can use npm to install the node-wot packages that you need.
83
+
Todo so, `cd` inside your application folder and install at least the mandatory core package:
85
84
86
85
```
87
-
npm i @node-wot/core @node-wot/binding-http --save
86
+
npm i @node-wot/core
88
87
```
89
88
90
-
#### Browser
89
+
Usually, your application needs at least one protocol binding to commmunicate, e.g.,:
91
90
92
-
To use node-wot as a browser-side JavaScript Library, the browser needs to support ECMAScript 2015.
91
+
```
92
+
npm i @node-wot/binding-http
93
+
```
93
94
94
-
Using a browser with only ES5 support (e.g., IE 11) might be possible if you add polyfills. If you want to use node-wot as a library in your browser application, you can install the `@node-wot/browser-bundle` as following:
95
+
In case the application shall consume Thing Descriptions that are stored locally, you would also need the `file` binding:
95
96
96
97
```
97
-
npm i @node-wot/browser-bundle --save
98
+
npm i @node-wot/binding-file
98
99
```
99
100
100
-
you can find more installation options in the specific [package README](./packages/browser-bundle/README.md).
101
+
You see other available bindings in the [packages folder](./packages), which you can install via `npm i @node-wot/<package-name>`.
102
+
103
+
### In the browser
104
+
105
+
To use node-wot as JavaScript library insde the Web browser, it needs to support ECMAScript 2015+. Using a browser with only ES5 support (e.g., IE 11) might be possible if you add polyfills.
106
+
107
+
If you want to use node-wot as a library in your browser application,`cd` inside your application folder and install the browser bundle:
108
+
109
+
```
110
+
npm i @node-wot/browser-bundle
111
+
```
112
+
113
+
You can find more (non-)installation options in the specific [package README](./packages/browser-bundle/README.md).
101
114
102
115
### As a CLI tool
103
116
104
-
You can alternatively use node-wot via its command line interface (CLI). Please visit the [CLI tool's Readme](<[url](https://github.com/eclipse-thingweb/node-wot/tree/master/packages/cli)>) to find out more.
117
+
You can alternatively use node-wot via its command line interface (CLI). Please visit the [CLI tool README](./packages/cli/README.md) to find out more.
118
+
119
+
#### As global tool
120
+
121
+
To make the `wot-servient` command available on your machine, install the CLI tool in the global scope:
0 commit comments