@xylabs/timer 5.0.95 → 5.0.97
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 +54 -65
- package/package.json +7 -10
package/README.md
CHANGED
|
@@ -1,120 +1,109 @@
|
|
|
1
1
|
# @xylabs/timer
|
|
2
2
|
|
|
3
|
-
[![
|
|
3
|
+
[![npm][npm-badge]][npm-link]
|
|
4
|
+
[![license][license-badge]][license-link]
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
[![npm-badge][]][npm-link]
|
|
7
|
-
[![npm-downloads-badge][]][npm-link]
|
|
8
|
-
[![jsdelivr-badge][]][jsdelivr-link]
|
|
9
|
-
[![npm-license-badge][]](LICENSE)
|
|
10
|
-
[![codacy-badge][]][codacy-link]
|
|
11
|
-
[![codeclimate-badge][]][codeclimate-link]
|
|
12
|
-
[![snyk-badge][]][snyk-link]
|
|
13
|
-
[![socket-badge][]][socket-link]
|
|
6
|
+
> Base functionality used throughout XY Labs TypeScript/JavaScript libraries
|
|
14
7
|
|
|
8
|
+
## Install
|
|
15
9
|
|
|
16
|
-
|
|
10
|
+
Using npm:
|
|
17
11
|
|
|
12
|
+
```sh
|
|
13
|
+
npm install {{name}}
|
|
14
|
+
```
|
|
18
15
|
|
|
16
|
+
Using yarn:
|
|
19
17
|
|
|
20
|
-
|
|
18
|
+
```sh
|
|
19
|
+
yarn add {{name}}
|
|
20
|
+
```
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
Using pnpm:
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
```sh
|
|
25
|
+
pnpm add {{name}}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Using bun:
|
|
29
|
+
|
|
30
|
+
```sh
|
|
31
|
+
bun add {{name}}
|
|
32
|
+
```
|
|
25
33
|
|
|
26
|
-
## Functions
|
|
27
34
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
35
|
+
## License
|
|
36
|
+
|
|
37
|
+
See the [LICENSE](LICENSE) file for license rights and limitations (LGPL-3.0-only).
|
|
38
|
+
|
|
39
|
+
## Reference
|
|
32
40
|
|
|
33
|
-
###
|
|
41
|
+
### packages
|
|
34
42
|
|
|
35
|
-
###
|
|
43
|
+
### timer
|
|
44
|
+
|
|
45
|
+
### .temp-typedoc
|
|
46
|
+
|
|
47
|
+
### functions
|
|
48
|
+
|
|
49
|
+
### <a id="clearTimeoutEx"></a>clearTimeoutEx
|
|
36
50
|
|
|
37
51
|
[**@xylabs/timer**](#../README)
|
|
38
52
|
|
|
39
53
|
***
|
|
40
54
|
|
|
41
55
|
```ts
|
|
42
|
-
function clearTimeoutEx(id
|
|
56
|
+
function clearTimeoutEx(id): void;
|
|
43
57
|
```
|
|
44
58
|
|
|
45
59
|
Cancels a timeout previously created with setTimeoutEx.
|
|
46
60
|
|
|
47
61
|
## Parameters
|
|
48
62
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
63
|
+
### id
|
|
64
|
+
|
|
65
|
+
`string`
|
|
66
|
+
|
|
67
|
+
The timeout ID returned by setTimeoutEx.
|
|
52
68
|
|
|
53
69
|
## Returns
|
|
54
70
|
|
|
55
71
|
`void`
|
|
56
72
|
|
|
57
|
-
|
|
73
|
+
### <a id="setTimeoutEx"></a>setTimeoutEx
|
|
58
74
|
|
|
59
75
|
[**@xylabs/timer**](#../README)
|
|
60
76
|
|
|
61
77
|
***
|
|
62
78
|
|
|
63
79
|
```ts
|
|
64
|
-
function setTimeoutEx(func
|
|
80
|
+
function setTimeoutEx(func, delay): string;
|
|
65
81
|
```
|
|
66
82
|
|
|
67
83
|
Sets a timeout using an optimized internal timer that coalesces multiple timeouts into a single native timer.
|
|
68
84
|
|
|
69
85
|
## Parameters
|
|
70
86
|
|
|
71
|
-
|
|
72
|
-
| ------ | ------ | ------ |
|
|
73
|
-
| `func` | `Function` | The function to call after the delay. |
|
|
74
|
-
| `delay` | `number` | The delay in milliseconds (must be >= 0). |
|
|
75
|
-
|
|
76
|
-
## Returns
|
|
77
|
-
|
|
78
|
-
`string`
|
|
87
|
+
### func
|
|
79
88
|
|
|
80
|
-
|
|
89
|
+
`Function`
|
|
81
90
|
|
|
91
|
+
The function to call after the delay.
|
|
82
92
|
|
|
83
|
-
|
|
93
|
+
### delay
|
|
84
94
|
|
|
85
|
-
|
|
95
|
+
`number`
|
|
86
96
|
|
|
87
|
-
|
|
88
|
-
- [Matt Jones](https://github.com/jonesmac)
|
|
89
|
-
- [Joel Carter](https://github.com/JoelBCarter)
|
|
90
|
-
- [Jordan Trouw](https://github.com/jordantrouw)
|
|
97
|
+
The delay in milliseconds (must be >= 0).
|
|
91
98
|
|
|
92
|
-
##
|
|
93
|
-
|
|
94
|
-
> See the [LICENSE](LICENSE) file for license details
|
|
99
|
+
## Returns
|
|
95
100
|
|
|
96
|
-
|
|
101
|
+
`string`
|
|
97
102
|
|
|
98
|
-
|
|
103
|
+
A unique string ID that can be used with clearTimeoutEx to cancel the timeout.
|
|
99
104
|
|
|
100
|
-
[logo]: https://cdn.xy.company/img/brand/XYPersistentCompany_Logo_Icon_Colored.svg
|
|
101
105
|
|
|
102
|
-
[main-build]: https://github.com/xylabs/sdk-js/actions/workflows/build.yml/badge.svg
|
|
103
|
-
[main-build-link]: https://github.com/xylabs/sdk-js/actions/workflows/build.yml
|
|
104
106
|
[npm-badge]: https://img.shields.io/npm/v/@xylabs/timer.svg
|
|
105
107
|
[npm-link]: https://www.npmjs.com/package/@xylabs/timer
|
|
106
|
-
[
|
|
107
|
-
[
|
|
108
|
-
[codeclimate-badge]: https://api.codeclimate.com/v1/badges/c5eb068f806f0b047ea7/maintainability
|
|
109
|
-
[codeclimate-link]: https://codeclimate.com/github/xylabs/sdk-js/maintainability
|
|
110
|
-
[snyk-badge]: https://snyk.io/test/github/xylabs/sdk-js/badge.svg?targetFile=package.json
|
|
111
|
-
[snyk-link]: https://snyk.io/test/github/xylabs/sdk-js?targetFile=package.json
|
|
112
|
-
|
|
113
|
-
[npm-downloads-badge]: https://img.shields.io/npm/dw/@xylabs/timer
|
|
114
|
-
[npm-license-badge]: https://img.shields.io/npm/l/@xylabs/timer
|
|
115
|
-
|
|
116
|
-
[jsdelivr-badge]: https://data.jsdelivr.com/v1/package/npm/@xylabs/timer/badge
|
|
117
|
-
[jsdelivr-link]: https://www.jsdelivr.com/package/npm/@xylabs/timer
|
|
118
|
-
|
|
119
|
-
[socket-badge]: https://socket.dev/api/badge/npm/package/@xylabs/timer
|
|
120
|
-
[socket-link]: https://socket.dev/npm/package/@xylabs/timer
|
|
108
|
+
[license-badge]: https://img.shields.io/npm/l/@xylabs/timer.svg
|
|
109
|
+
[license-link]: https://github.com/xylabs/sdk-js/blob/main/LICENSE
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xylabs/timer",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.97",
|
|
4
4
|
"description": "Base functionality used throughout XY Labs TypeScript/JavaScript libraries",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"xylabs",
|
|
@@ -30,12 +30,10 @@
|
|
|
30
30
|
"exports": {
|
|
31
31
|
".": {
|
|
32
32
|
"types": "./dist/neutral/index.d.ts",
|
|
33
|
-
"import": "./dist/neutral/index.mjs",
|
|
34
33
|
"default": "./dist/neutral/index.mjs"
|
|
35
34
|
},
|
|
36
35
|
"./package.json": "./package.json"
|
|
37
36
|
},
|
|
38
|
-
"types": "./dist/neutral/index.d.ts",
|
|
39
37
|
"files": [
|
|
40
38
|
"dist",
|
|
41
39
|
"!**/*.bench.*",
|
|
@@ -44,17 +42,16 @@
|
|
|
44
42
|
"README.md"
|
|
45
43
|
],
|
|
46
44
|
"dependencies": {
|
|
47
|
-
"@xylabs/assert": "~5.0.
|
|
45
|
+
"@xylabs/assert": "~5.0.97"
|
|
48
46
|
},
|
|
49
47
|
"devDependencies": {
|
|
50
|
-
"@types/node": "^25.
|
|
51
|
-
"@xylabs/
|
|
52
|
-
"@xylabs/
|
|
53
|
-
"@xylabs/tsconfig": "~7.8.4",
|
|
48
|
+
"@types/node": "^25.6.0",
|
|
49
|
+
"@xylabs/toolchain": "~7.10.4",
|
|
50
|
+
"@xylabs/tsconfig": "~7.10.4",
|
|
54
51
|
"esbuild": "^0.28.0",
|
|
55
52
|
"typescript": "^5",
|
|
56
|
-
"vite": "^8.0.
|
|
57
|
-
"vitest": "^4.1.
|
|
53
|
+
"vite": "^8.0.8",
|
|
54
|
+
"vitest": "^4.1.4"
|
|
58
55
|
},
|
|
59
56
|
"engines": {
|
|
60
57
|
"node": ">=18"
|