Skip to content

Commit 5ef9dea

Browse files
authored
docs: revise README
Trying to streamline the information given in the README for "new" users (including people who have not used it in a long time).
1 parent 28af07c commit 5ef9dea

File tree

1 file changed

+35
-14
lines changed

1 file changed

+35
-14
lines changed

README.md

Lines changed: 35 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,9 @@ For further information please refer to the official [W3C Web of Things](https:/
5656

5757
## Installation
5858

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 install the 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.
6060

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
6662

6763
> [!WARNING]
6864
> We no longer actively support Node.js version 18 and lower.
@@ -81,27 +77,52 @@ Platforms specific prerequisites:
8177
- Mac OS: Meet the [node-gyp](https://github.com/nodejs/node-gyp#installation) requirements:
8278
- `xcode-select --install`
8379

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:
8584

8685
```
87-
npm i @node-wot/core @node-wot/binding-http --save
86+
npm i @node-wot/core
8887
```
8988

90-
#### Browser
89+
Usually, your application needs at least one protocol binding to commmunicate, e.g.,:
9190

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+
```
9394

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:
9596

9697
```
97-
npm i @node-wot/browser-bundle --save
98+
npm i @node-wot/binding-file
9899
```
99100

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).
101114

102115
### As a CLI tool
103116

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:
122+
123+
```
124+
npm i @node-wot/cli -g
125+
```
105126

106127
#### As a docker image
107128

0 commit comments

Comments
 (0)