waiit 1.0.1 → 2.0.0
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.
- package/README.md +14 -2
- package/cli.js +2 -0
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ Promise-based delay utility. Tiny, typed, zero dependencies.
|
|
|
8
8
|
|
|
9
9
|
## Features
|
|
10
10
|
|
|
11
|
-
🪶 Lightweight (1 line) · ⚡ Simple async/await API · 📦 TypeScript ready · 🔧 Flexible · 🌐 Universal (Node.js & Browser)
|
|
11
|
+
🪶 Lightweight (1 line) · ⚡ Simple async/await API · 📦 TypeScript ready · 🔧 Flexible · 🌐 Universal (Node.js & Browser) · 💻 CLI support
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
## Install
|
|
@@ -66,10 +66,22 @@ async function fetchWithRetry(url, retries = 3) {
|
|
|
66
66
|
```js
|
|
67
67
|
for (const step of steps) {
|
|
68
68
|
console.log(step.message);
|
|
69
|
-
wait(step.delay);
|
|
69
|
+
await wait(step.delay);
|
|
70
70
|
}
|
|
71
71
|
```
|
|
72
72
|
|
|
73
|
+
## CLI
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
# Via npx
|
|
77
|
+
npx waiit 2000 # Wait 2 seconds
|
|
78
|
+
|
|
79
|
+
# Or install globally
|
|
80
|
+
npm i -g waiit
|
|
81
|
+
waiit 3000 # Wait 3 seconds
|
|
82
|
+
waiit # Exit immediately
|
|
83
|
+
```
|
|
84
|
+
|
|
73
85
|
## License
|
|
74
86
|
|
|
75
87
|
[MIT](LICENSE) © Raju Dhami
|
package/cli.js
ADDED
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "waiit",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Promise-based delay utility. Tiny, typed, zero dependencies.",
|
|
5
5
|
"main": "app.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
7
|
+
"bin": "cli.js",
|
|
7
8
|
"exports": {
|
|
8
9
|
".": {
|
|
9
10
|
"types": "./index.d.ts",
|
|
@@ -12,8 +13,8 @@
|
|
|
12
13
|
}
|
|
13
14
|
},
|
|
14
15
|
"repository": "Raju/waiit",
|
|
15
|
-
"keywords": ["wait","delay","sleep","timeout","promise","async","await","setTimeout","timer","pause","browser","node"],
|
|
16
|
+
"keywords": ["wait","delay","sleep","timeout","promise","async","await","setTimeout","timer","pause","browser","node","cli"],
|
|
16
17
|
"author": "Raju Dhami",
|
|
17
18
|
"license": "MIT",
|
|
18
|
-
"files": ["app.js", "index.d.ts"]
|
|
19
|
+
"files": ["app.js", "index.d.ts", "cli.js"]
|
|
19
20
|
}
|