@uns-kit/cron 0.0.8 → 0.0.9
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 +11 -7
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -16,15 +16,19 @@ You will also need `@uns-kit/core` in your project because the plugin augments `
|
|
|
16
16
|
|
|
17
17
|
```ts
|
|
18
18
|
import UnsProxyProcess from "@uns-kit/core/uns/uns-proxy-process";
|
|
19
|
-
import
|
|
19
|
+
import type { UnsProxyProcessWithCron } from "@uns-kit/cron";
|
|
20
|
+
import "@uns-kit/cron";
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
async function main() {
|
|
23
|
+
const process = new UnsProxyProcess("mqtt-broker:1883", { processName: "cron-demo" }) as UnsProxyProcessWithCron;
|
|
23
24
|
|
|
24
|
-
const cronProxy = await process.createCrontabProxy("
|
|
25
|
-
cronProxy.event.on("cronEvent", () => {
|
|
26
|
-
|
|
27
|
-
});
|
|
25
|
+
const cronProxy = await process.createCrontabProxy("*/5 * * * *");
|
|
26
|
+
cronProxy.event.on("cronEvent", () => {
|
|
27
|
+
console.log("tick");
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
void main();
|
|
28
32
|
```
|
|
29
33
|
|
|
30
34
|
## Scripts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uns-kit/cron",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"description": "Cron-driven plugin for UnsProxyProcess that emits UNS events on a schedule.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"types": "dist/index.d.ts",
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"node-cron": "^4.2.1",
|
|
35
|
-
"@uns-kit/core": "0.0.
|
|
35
|
+
"@uns-kit/core": "0.0.21"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
38
38
|
"build": "tsc -p tsconfig.build.json",
|