node-web-gpio 1.1.21 → 1.1.23

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 +18 -19
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -4,31 +4,30 @@ GPIO access with Node.js
4
4
 
5
5
  ## Usage
6
6
 
7
+ ```
8
+ $ npm i node-web-gpio
9
+ ```
10
+
7
11
  ```js
8
- const { requestGPIOAccess } = require("node-web-gpio");
9
- const { promisify } = require("util");
10
- const sleep = promisify(setTimeout);
11
-
12
- async function main() {
13
- const gpioAccess = await requestGPIOAccess();
14
- const port = gpioAccess.ports.get(26);
15
-
16
- await port.export("out");
17
-
18
- for (;;) {
19
- await port.write(1);
20
- await sleep(1000);
21
- await port.write(0);
22
- await sleep(1000);
23
- }
24
- }
12
+ import { requestGPIOAccess } from "node-web-gpio";
13
+ import { setTimeout as sleep } from "node:timers/promises";
25
14
 
26
- main();
15
+ const gpioAccess = await requestGPIOAccess();
16
+ const port = gpioAccess.ports.get(26);
17
+
18
+ await port.export("out");
19
+
20
+ while (true) {
21
+ await port.write(1);
22
+ await sleep(1000);
23
+ await port.write(0);
24
+ await sleep(1000);
25
+ }
27
26
  ```
28
27
 
29
28
  ## Document
30
29
 
31
- - [TSDoc](http://chirimen.org/node-web-gpio/)
30
+ - [TSDoc](http://www.chirimen.org/node-web-gpio/)
32
31
 
33
32
  ## Reference
34
33
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-web-gpio",
3
- "version": "1.1.21",
3
+ "version": "1.1.23",
4
4
  "description": "GPIO access with Node.js",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -45,5 +45,5 @@
45
45
  "robots",
46
46
  "rpi"
47
47
  ],
48
- "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
48
+ "packageManager": "npm@11.0.0"
49
49
  }