cron 4.3.3 → 4.3.5

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 (3) hide show
  1. package/CHANGELOG.md +94 -0
  2. package/dist/job.js +16 -3
  3. package/package.json +15 -16
package/CHANGELOG.md CHANGED
@@ -1,3 +1,97 @@
1
+ ## [4.3.5](https://github.com/kelektiv/node-cron/compare/v4.3.4...v4.3.5) (2025-11-30)
2
+
3
+ ### 🐛 Bug Fixes
4
+
5
+ * suppress setTimeout warning with negatives ([#1030](https://github.com/kelektiv/node-cron/issues/1030)) ([74d3b74](https://github.com/kelektiv/node-cron/commit/74d3b74dd42adeb348d6e13dd798d61fb68073a7)), closes [#1000](https://github.com/kelektiv/node-cron/issues/1000)
6
+
7
+ ### ♻️ Chores
8
+
9
+ * **action:** update actions/checkout action to v5.0.1 ([0f3b9f3](https://github.com/kelektiv/node-cron/commit/0f3b9f3c12ea9e2cb8567570551f79d557f53b5f))
10
+ * **action:** update actions/checkout action to v6 ([#1028](https://github.com/kelektiv/node-cron/issues/1028)) ([232f23a](https://github.com/kelektiv/node-cron/commit/232f23adad475b70f8c958b29d47f32eb905fb96))
11
+ * **action:** update actions/create-github-app-token action to v2.2.0 ([1ade9ce](https://github.com/kelektiv/node-cron/commit/1ade9ce4ac91a5703798e1c219c59bf92abfdd81))
12
+ * **action:** update actions/setup-node action to v6 ([#1017](https://github.com/kelektiv/node-cron/issues/1017)) ([288cf0d](https://github.com/kelektiv/node-cron/commit/288cf0d83f546b86d5a7bd804a8e88182a6f38cd))
13
+ * **action:** update actions/upload-artifact action to v5 ([#1018](https://github.com/kelektiv/node-cron/issues/1018)) ([7091186](https://github.com/kelektiv/node-cron/commit/709118655aab2d222f50f3a9aff36bc50e0742fa))
14
+ * **action:** update github/codeql-action action to v3.31.2 ([8c5c4db](https://github.com/kelektiv/node-cron/commit/8c5c4db54cc2221181f839c849766dbf54a886db))
15
+ * **action:** update github/codeql-action action to v3.31.5 ([c6516f1](https://github.com/kelektiv/node-cron/commit/c6516f1cbfa8c0d3e453f5d77b14ac02faabc59a))
16
+ * **action:** update github/codeql-action action to v4 ([#1014](https://github.com/kelektiv/node-cron/issues/1014)) ([258ee3b](https://github.com/kelektiv/node-cron/commit/258ee3b0502042720fef103f864e7ffea34783ac))
17
+ * **action:** update step-security/harden-runner action to v2.13.2 ([2f44428](https://github.com/kelektiv/node-cron/commit/2f44428f3aec7829a049bb11cbbb2ed346fdf579))
18
+ * **deps:** update dependency [@eslint](https://github.com/eslint)/js to v9.39.1 ([319462a](https://github.com/kelektiv/node-cron/commit/319462a0f972c3b1c15aa62c4b4bbfcdf7cfe251))
19
+ * **deps:** update dependency [@semantic-release](https://github.com/semantic-release)/github to v12.0.1 ([dfa3411](https://github.com/kelektiv/node-cron/commit/dfa341118e126dbe2e2f7be36b81d9a434cc9608))
20
+ * **deps:** update dependency [@swc](https://github.com/swc)/core to v1.15.0 ([7aa02a2](https://github.com/kelektiv/node-cron/commit/7aa02a2e5996902ecbe9ed69c047cf0093cbea71))
21
+ * **deps:** update dependency [@swc](https://github.com/swc)/core to v1.15.3 ([af87e4d](https://github.com/kelektiv/node-cron/commit/af87e4d391315d72ddddaddac96e43c0eef1936e))
22
+ * **deps:** update dependency [@types](https://github.com/types)/node to v22.19.0 ([67701aa](https://github.com/kelektiv/node-cron/commit/67701aa2de16a78927ed788c07158e0b2d34fe46))
23
+ * **deps:** update dependency [@types](https://github.com/types)/node to v22.19.1 ([2c0d2bb](https://github.com/kelektiv/node-cron/commit/2c0d2bb069847f00ab0246499ea7e21fe34eed6f))
24
+ * **deps:** update dependency [@types](https://github.com/types)/sinon to v21 ([#1029](https://github.com/kelektiv/node-cron/issues/1029)) ([028b8b7](https://github.com/kelektiv/node-cron/commit/028b8b737c1a03c4baba4ebb325e04221adf686c))
25
+ * **deps:** update semantic-release related packages ([e29b122](https://github.com/kelektiv/node-cron/commit/e29b122f0c220b654bdfeeccf6a3408144efd145))
26
+
27
+ ## [4.3.4](https://github.com/kelektiv/node-cron/compare/v4.3.3...v4.3.4) (2025-11-06)
28
+
29
+ ### 🐛 Bug Fixes
30
+
31
+ * catch errors in async onTick functions ([#1013](https://github.com/kelektiv/node-cron/issues/1013)) ([2ac3001](https://github.com/kelektiv/node-cron/commit/2ac300176017202cf74e281f0ec85541a961c5d2))
32
+
33
+ ### 🛠 Builds
34
+
35
+ * add GitHub app token to use for release ([#1024](https://github.com/kelektiv/node-cron/issues/1024)) ([61b54f6](https://github.com/kelektiv/node-cron/commit/61b54f62940105312b4d5921a08ec57231474edb))
36
+ * remove chai since we aren't using it ([#1012](https://github.com/kelektiv/node-cron/issues/1012)) ([cf14205](https://github.com/kelektiv/node-cron/commit/cf14205a36898cad43c4ad36460a9eb457882bdf))
37
+ * switch to using built in GitHub token ([#1022](https://github.com/kelektiv/node-cron/issues/1022)) ([d24b3ea](https://github.com/kelektiv/node-cron/commit/d24b3ea1d19b463bf27826513d8f917d56aea77b))
38
+ * update release config to use trusted publishing ([#1023](https://github.com/kelektiv/node-cron/issues/1023)) ([0cb3ff6](https://github.com/kelektiv/node-cron/commit/0cb3ff6e6a561aec4ea5e2e120eb78a31a5f9b5e)), closes [#1017](https://github.com/kelektiv/node-cron/issues/1017) [#1018](https://github.com/kelektiv/node-cron/issues/1018)
39
+ * use trusted publishing to publish to NPM ([#1021](https://github.com/kelektiv/node-cron/issues/1021)) ([44f14f3](https://github.com/kelektiv/node-cron/commit/44f14f38dcbf405053354c4e1f5dbcad6d757b66))
40
+
41
+ ### ♻️ Chores
42
+
43
+ * **action:** update actions/checkout action to v4.3.0 ([d8913b8](https://github.com/kelektiv/node-cron/commit/d8913b8a835e79095b84695baf3b6eea9a30bb43))
44
+ * **action:** update actions/checkout action to v5 ([#1005](https://github.com/kelektiv/node-cron/issues/1005)) ([2e2a021](https://github.com/kelektiv/node-cron/commit/2e2a02198b3e74b6526499ce1e246ed9aba9d587))
45
+ * **action:** update actions/setup-node action to v5 ([#1009](https://github.com/kelektiv/node-cron/issues/1009)) ([4a7f1f3](https://github.com/kelektiv/node-cron/commit/4a7f1f346d491632679183dbe1bfba4eabd48286))
46
+ * **action:** update amannn/action-semantic-pull-request action to v6 ([#1006](https://github.com/kelektiv/node-cron/issues/1006)) ([832ca6e](https://github.com/kelektiv/node-cron/commit/832ca6e40687bd13153001c243f684173e140cf7))
47
+ * **action:** update github/codeql-action action to v3.29.11 ([ec90183](https://github.com/kelektiv/node-cron/commit/ec90183c7be532d0dd45a97fd4aa165a16c81d55))
48
+ * **action:** update github/codeql-action action to v3.29.8 ([842e3e0](https://github.com/kelektiv/node-cron/commit/842e3e0cfe1a581a0993705e09440dd952723c39))
49
+ * **action:** update github/codeql-action action to v3.30.3 ([#1010](https://github.com/kelektiv/node-cron/issues/1010)) ([b195a01](https://github.com/kelektiv/node-cron/commit/b195a015471dca39b59220f745f2f840726ec9ef))
50
+ * **action:** update github/codeql-action action to v3.30.4 ([45a48b8](https://github.com/kelektiv/node-cron/commit/45a48b8c9067e947b734ccbe8ab1de700f2d80de))
51
+ * **action:** update github/codeql-action action to v3.30.7 ([5de5bfc](https://github.com/kelektiv/node-cron/commit/5de5bfcc31f7657acbfce9933ef5bb17ada72bcd))
52
+ * **action:** update github/codeql-action action to v3.30.8 ([4df56a5](https://github.com/kelektiv/node-cron/commit/4df56a5acf9eb38a1aa47baafb729d2685b1b05b))
53
+ * **action:** update github/codeql-action action to v3.31.0 ([14d7498](https://github.com/kelektiv/node-cron/commit/14d74984fcfd9bdcd5a04461582205b3f4e2f678))
54
+ * **action:** update ossf/scorecard-action action to v2.4.3 ([e8a33a0](https://github.com/kelektiv/node-cron/commit/e8a33a05fd7c417583957296af5695dd8b751c65))
55
+ * **action:** update step-security/harden-runner action to v2.13.1 ([2a4a2c2](https://github.com/kelektiv/node-cron/commit/2a4a2c2c94abdf6a2c6081fd844c5fffd09733bd))
56
+ * **deps:** lock file maintenance ([1de94a3](https://github.com/kelektiv/node-cron/commit/1de94a3afcf130b608310a3e3613044f7c6d504b))
57
+ * **deps:** lock file maintenance ([420c4b1](https://github.com/kelektiv/node-cron/commit/420c4b1b93eceb9afba7442f2bd77446df2506bf))
58
+ * **deps:** lock file maintenance ([ac128a2](https://github.com/kelektiv/node-cron/commit/ac128a2d64a34c9d4d984ef6f2bdf2cab7a030e5))
59
+ * **deps:** lock file maintenance ([573faca](https://github.com/kelektiv/node-cron/commit/573facaec3e62dcbb66140cb9240f448322ae275))
60
+ * **deps:** lock file maintenance ([bbb3ab2](https://github.com/kelektiv/node-cron/commit/bbb3ab21bc6249ae8206679cba381dd91a2105bd))
61
+ * **deps:** lock file maintenance ([fd06770](https://github.com/kelektiv/node-cron/commit/fd06770c325b07252682ddaa619948d379be37c4))
62
+ * **deps:** lock file maintenance ([3c5769e](https://github.com/kelektiv/node-cron/commit/3c5769efeff562a436703f120f2c37b84f0c7f74))
63
+ * **deps:** lock file maintenance ([51e2121](https://github.com/kelektiv/node-cron/commit/51e212188a1d6787a55c34d7aa1616e17e68d10d))
64
+ * **deps:** lock file maintenance ([daf30a6](https://github.com/kelektiv/node-cron/commit/daf30a60c2ed3f9b1b70f0b40999f3204d9b5536))
65
+ * **deps:** lock file maintenance ([a60f049](https://github.com/kelektiv/node-cron/commit/a60f04931e0de28d8a716f52b83011c6c9036ef2))
66
+ * **deps:** lock file maintenance ([555cbbf](https://github.com/kelektiv/node-cron/commit/555cbbfe82a23fbb0d0dac5d6e8f9ebd61e70a4a))
67
+ * **deps:** lock file maintenance ([a330852](https://github.com/kelektiv/node-cron/commit/a330852fce41c60c83abebc9b09506dae8486d11))
68
+ * **deps:** lock file maintenance ([90fbb48](https://github.com/kelektiv/node-cron/commit/90fbb487bc84f8da0bbea61be0595c91e3b22fa6))
69
+ * **deps:** update dependency [@eslint](https://github.com/eslint)/js to v9.34.0 ([cdf3a2d](https://github.com/kelektiv/node-cron/commit/cdf3a2de3a3040b2f9ef8427a462d09ceb8a420a))
70
+ * **deps:** update dependency [@eslint](https://github.com/eslint)/js to v9.35.0 ([#1011](https://github.com/kelektiv/node-cron/issues/1011)) ([64c84bd](https://github.com/kelektiv/node-cron/commit/64c84bd04e2218652d43bfc0582f56323adedc22))
71
+ * **deps:** update dependency [@eslint](https://github.com/eslint)/js to v9.36.0 ([23e0fbc](https://github.com/kelektiv/node-cron/commit/23e0fbc572aa8c33696766f16e7b75163fb046ae))
72
+ * **deps:** update dependency [@eslint](https://github.com/eslint)/js to v9.37.0 ([3a20922](https://github.com/kelektiv/node-cron/commit/3a209225620cc013b06ece09445a4fbcea6b7627))
73
+ * **deps:** update dependency [@eslint](https://github.com/eslint)/js to v9.38.0 ([#1020](https://github.com/kelektiv/node-cron/issues/1020)) ([b853a38](https://github.com/kelektiv/node-cron/commit/b853a388754a49f853e8b011e52eb96fd8267783))
74
+ * **deps:** update dependency [@semantic-release](https://github.com/semantic-release)/github to v11.0.4 ([#1007](https://github.com/kelektiv/node-cron/issues/1007)) ([d04396d](https://github.com/kelektiv/node-cron/commit/d04396da14c3f8b17b4ca14e28a0470b8eaa3c34))
75
+ * **deps:** update dependency [@swc](https://github.com/swc)/core to v1.13.20 ([#1019](https://github.com/kelektiv/node-cron/issues/1019)) ([c906a92](https://github.com/kelektiv/node-cron/commit/c906a92c1f6e315d5c58cdf31ad8d4382b33ba63))
76
+ * **deps:** update dependency [@swc](https://github.com/swc)/core to v1.13.3 ([461e602](https://github.com/kelektiv/node-cron/commit/461e602bd7e0233e8ddcbbeab734618a65484b60))
77
+ * **deps:** update dependency [@swc](https://github.com/swc)/core to v1.13.4 ([7665c00](https://github.com/kelektiv/node-cron/commit/7665c000553e94f3690b2ba0f36a5531121fc6c6))
78
+ * **deps:** update dependency [@swc](https://github.com/swc)/core to v1.13.5 ([5b74613](https://github.com/kelektiv/node-cron/commit/5b746130a61533836d0fb67550dd3d84bda321be))
79
+ * **deps:** update dependency [@types](https://github.com/types)/node to v22.17.0 ([40603d9](https://github.com/kelektiv/node-cron/commit/40603d91ef0c0ab22122301043ba0c8447d6a5c1))
80
+ * **deps:** update dependency [@types](https://github.com/types)/node to v22.17.2 ([cce46b8](https://github.com/kelektiv/node-cron/commit/cce46b8b9622f54134931ecb08f9070ffbc8ed4f))
81
+ * **deps:** update dependency [@types](https://github.com/types)/node to v22.18.1 ([9e07aab](https://github.com/kelektiv/node-cron/commit/9e07aabf6da956d981b190c9aaf159de7d409540))
82
+ * **deps:** update dependency [@types](https://github.com/types)/node to v22.18.12 ([3d8843d](https://github.com/kelektiv/node-cron/commit/3d8843d6588739cc2ef2691b4665227012919a4d))
83
+ * **deps:** update dependency [@types](https://github.com/types)/node to v22.18.6 ([438addc](https://github.com/kelektiv/node-cron/commit/438addcdde9dcf3034c3a761e083ad9a6d572062))
84
+ * **deps:** update dependency [@types](https://github.com/types)/node to v22.18.8 ([18f6c48](https://github.com/kelektiv/node-cron/commit/18f6c48651c43edbc80ad2217bdbddd668e956fb))
85
+ * **deps:** update dependency chai to v5.3.3 ([#1008](https://github.com/kelektiv/node-cron/issues/1008)) ([a308ecb](https://github.com/kelektiv/node-cron/commit/a308ecb958992f67ab61ec5ecb709c77c9ddea71))
86
+ * **deps:** update dependency jest to v30.2.0 ([bad0c07](https://github.com/kelektiv/node-cron/commit/bad0c07c43c7df971ee0453c8d4608c3cc31c9fd))
87
+ * **deps:** update dependency typescript to v5.9.2 ([411a2da](https://github.com/kelektiv/node-cron/commit/411a2dad1cb287779803f3ed3e6ef13bc425357d))
88
+ * **deps:** update dependency typescript to v5.9.3 ([2251f01](https://github.com/kelektiv/node-cron/commit/2251f010c5e8b41d24a381dcd46f959239606491))
89
+ * **deps:** update linters ([26069e5](https://github.com/kelektiv/node-cron/commit/26069e5c5ffe17959e812cac12b99796d03ae9ea))
90
+ * **deps:** update semantic-release related packages ([4c56e18](https://github.com/kelektiv/node-cron/commit/4c56e181b8035b9a5fe390d66d09c67e00d3ed2c))
91
+ * **deps:** update semantic-release related packages ([bafbf3b](https://github.com/kelektiv/node-cron/commit/bafbf3bbc565d5c02b35644bb9ba6384b9e5f063))
92
+ * **deps:** update semantic-release related packages (major) ([#1015](https://github.com/kelektiv/node-cron/issues/1015)) ([7b06e1d](https://github.com/kelektiv/node-cron/commit/7b06e1da37cbbee922e02e2ce1ef0aa356748388))
93
+ * **deps:** update tests (major) ([#998](https://github.com/kelektiv/node-cron/issues/998)) ([99670af](https://github.com/kelektiv/node-cron/commit/99670afcaace5a62b2b803f87450b3606abc1f38))
94
+
1
95
  ## [4.3.3](https://github.com/kelektiv/node-cron/compare/v4.3.2...v4.3.3) (2025-08-01)
2
96
 
3
97
  ### 🛠 Builds
package/dist/job.js CHANGED
@@ -124,8 +124,21 @@ class CronJob {
124
124
  try {
125
125
  for (const callback of this._callbacks) {
126
126
  const result = callback.call(this.context, this.onComplete);
127
- if (this.waitForCompletion)
128
- yield result;
127
+ if (result &&
128
+ typeof result === 'object' &&
129
+ typeof result.then === 'function') {
130
+ if (this.waitForCompletion) {
131
+ yield result;
132
+ }
133
+ else {
134
+ result.catch(error => {
135
+ if (this.errorHandler != null)
136
+ this.errorHandler(error);
137
+ else
138
+ console.error('[Cron] error in callback', error);
139
+ });
140
+ }
141
+ }
129
142
  }
130
143
  }
131
144
  catch (error) {
@@ -152,7 +165,7 @@ class CronJob {
152
165
  let startTime;
153
166
  const setCronTimeout = (t) => {
154
167
  startTime = Date.now();
155
- this._timeout = setTimeout(callbackWrapper, t);
168
+ this._timeout = setTimeout(callbackWrapper, Math.max(t, 1));
156
169
  if (this.unrefTimeout && typeof this._timeout.unref === 'function') {
157
170
  this._timeout.unref();
158
171
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cron",
3
3
  "description": "Cron jobs for your node",
4
- "version": "4.3.3",
4
+ "version": "4.3.5",
5
5
  "author": "Nick Campbell <nicholas.j.campbell@gmail.com> (https://github.com/ncb000gt)",
6
6
  "bugs": {
7
7
  "url": "https://github.com/kelektiv/node-cron/issues"
@@ -28,35 +28,34 @@
28
28
  "luxon": "~3.7.0"
29
29
  },
30
30
  "devDependencies": {
31
- "@commitlint/cli": "19.8.1",
32
- "@eslint/js": "9.31.0",
31
+ "@commitlint/cli": "20.1.0",
32
+ "@eslint/js": "9.39.1",
33
33
  "@fast-check/jest": "2.1.1",
34
34
  "@insurgent/commitlint-config": "20.0.0",
35
35
  "@insurgent/conventional-changelog-preset": "10.0.0",
36
36
  "@semantic-release/changelog": "6.0.3",
37
37
  "@semantic-release/commit-analyzer": "13.0.1",
38
38
  "@semantic-release/git": "10.0.1",
39
- "@semantic-release/github": "11.0.3",
40
- "@semantic-release/npm": "12.0.2",
41
- "@semantic-release/release-notes-generator": "14.0.3",
42
- "@swc/core": "1.13.2",
39
+ "@semantic-release/github": "12.0.2",
40
+ "@semantic-release/npm": "13.1.2",
41
+ "@semantic-release/release-notes-generator": "14.1.0",
42
+ "@swc/core": "1.15.3",
43
43
  "@swc/jest": "0.2.39",
44
- "@types/jest": "29.5.14",
45
- "@types/node": "22.16.5",
46
- "@types/sinon": "17.0.4",
47
- "chai": "5.2.1",
44
+ "@types/jest": "30.0.0",
45
+ "@types/node": "22.19.1",
46
+ "@types/sinon": "21.0.0",
48
47
  "cross-env": "7.0.3",
49
48
  "eslint": "8.57.1",
50
49
  "eslint-config-prettier": "9.1.2",
51
50
  "eslint-plugin-jest": "27.9.0",
52
- "eslint-plugin-prettier": "5.5.3",
51
+ "eslint-plugin-prettier": "5.5.4",
53
52
  "husky": "9.1.7",
54
- "jest": "29.7.0",
53
+ "jest": "30.2.0",
55
54
  "lint-staged": "15.5.2",
56
55
  "prettier": "3.6.2",
57
- "semantic-release": "24.2.7",
58
- "sinon": "20.0.0",
59
- "typescript": "5.8.3",
56
+ "semantic-release": "25.0.2",
57
+ "sinon": "21.0.0",
58
+ "typescript": "5.9.3",
60
59
  "typescript-eslint": "7.18.0"
61
60
  },
62
61
  "keywords": [