node-web-i2c 1.1.36 → 1.1.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +13 -16
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -4,27 +4,24 @@ I2C access with Node.js
4
4
 
5
5
  ## Usage
6
6
 
7
- ```js
8
- const { requestI2CAccess } = require("node-web-i2c");
9
- const ADT7410 = require("@chirimen/adt7410");
10
-
11
- const ADT7410_ADDR = 0x48;
12
-
13
- async function main() {
14
- const i2cAccess = await requestI2CAccess();
15
- const port = i2cAccess.ports.get(1);
16
- const adt7410 = new ADT7410(port, ADT7410_ADDR);
17
- await adt7410.init();
18
- const temperature = await adt7410.read();
19
- console.log(`Temperature: ${temperature} ℃`);
20
- }
7
+ ```
8
+ $ npm i node-web-i2c
9
+ ```
21
10
 
22
- main();
11
+ ```js
12
+ import { requestI2CAccess } from "node-web-i2c";
13
+ import ADT7410 from "@chirimen/adt7410";
14
+
15
+ const i2cAccess = await requestI2CAccess();
16
+ const adt7410 = new ADT7410(i2cAccess.ports.get(1), 0x48);
17
+ await adt7410.init();
18
+ const temperature = await adt7410.read();
19
+ console.log(`Temperature: ${temperature} ℃`);
23
20
  ```
24
21
 
25
22
  ## Document
26
23
 
27
- - [TSDoc](http://chirimen.org/node-web-i2c/)
24
+ - [TSDoc](http://www.chirimen.org/node-web-i2c/)
28
25
 
29
26
  ## Reference
30
27
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-web-i2c",
3
- "version": "1.1.36",
3
+ "version": "1.1.38",
4
4
  "description": "I2C access with Node.js",
5
5
  "main": "index.js",
6
6
  "files": [