waiit 3.0.0 → 3.0.2
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 +16 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -45,7 +45,7 @@ wait(ms?: number): Promise<void>
|
|
|
45
45
|
|
|
46
46
|
## Usage
|
|
47
47
|
|
|
48
|
-
### ES Modules
|
|
48
|
+
### ES Modules (`app.js`)
|
|
49
49
|
|
|
50
50
|
```js
|
|
51
51
|
import wait from 'waiit';
|
|
@@ -55,7 +55,7 @@ await wait(500); // Pause for 500ms
|
|
|
55
55
|
await wait(); // Continue immediately (0ms)
|
|
56
56
|
```
|
|
57
57
|
|
|
58
|
-
### CommonJS
|
|
58
|
+
### CommonJS (`app.cjs`)
|
|
59
59
|
|
|
60
60
|
```js
|
|
61
61
|
const wait = require('waiit');
|
|
@@ -65,7 +65,7 @@ await wait(2000);
|
|
|
65
65
|
|
|
66
66
|
### Browser (CDN)
|
|
67
67
|
|
|
68
|
-
**ES Modules:**
|
|
68
|
+
**ES Modules (`app.js`):**
|
|
69
69
|
```html
|
|
70
70
|
<script type="module">
|
|
71
71
|
import wait from 'https://unpkg.com/waiit/app.js';
|
|
@@ -75,9 +75,9 @@ await wait(2000);
|
|
|
75
75
|
</script>
|
|
76
76
|
```
|
|
77
77
|
|
|
78
|
-
**Classic Script (
|
|
78
|
+
**Classic Script (`app.global.js`):**
|
|
79
79
|
```html
|
|
80
|
-
<script src="https://unpkg.com/waiit/app.
|
|
80
|
+
<script src="https://unpkg.com/waiit/app.global.js"></script>
|
|
81
81
|
<script>
|
|
82
82
|
wait(1000).then(() => console.log('Done!'));
|
|
83
83
|
</script>
|
|
@@ -127,6 +127,17 @@ waiit 3000 && echo "3 seconds passed"
|
|
|
127
127
|
```
|
|
128
128
|
|
|
129
129
|
|
|
130
|
+
## Files
|
|
131
|
+
|
|
132
|
+
| File | Purpose |
|
|
133
|
+
|------|---------|
|
|
134
|
+
| `app.js` | ESM module (`import wait from 'waiit'`) |
|
|
135
|
+
| `app.cjs` | CommonJS module (`require('waiit')`) |
|
|
136
|
+
| `app.global.js` | UMD for browsers (`<script>` tag → `window.wait`) |
|
|
137
|
+
| `app.d.ts` | TypeScript type definitions |
|
|
138
|
+
| `app.cli.js` | CLI binary (`npx waiit 1000`) |
|
|
139
|
+
|
|
140
|
+
|
|
130
141
|
## License
|
|
131
142
|
|
|
132
143
|
[MIT](LICENSE) © [Raju Dhami](https://github.com/Raju)
|