@cldmv/holdmytask 2.0.3 → 2.0.4

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/README.md +15 -0
  2. package/index.cjs +12 -3
  3. package/package.json +5 -4
package/README.md CHANGED
@@ -10,6 +10,21 @@
10
10
 
11
11
  A tiny, dependency-free task queue for Node.js that executes tasks with priority ordering, concurrency control, and completion delays. Perfect for managing asynchronous workflows with sophisticated timing requirements.
12
12
 
13
+ ## ✨ What's New
14
+
15
+ ### Latest: v2.0.4 (October 2026)
16
+
17
+ - **Clearer `require()` failure on older Node.js** — The CommonJS entry now throws an `ERR_REQUIRE_ESM` error that names the supported Node.js versions (`^20.19.0` or `>=22.12.0`) and points to `import()`, instead of a bare error on versions without `require(esm)`. Behavior on supported versions is unchanged.
18
+ - **Security patch for development tooling** — Updates `brace-expansion` to 5.0.12, fixing [GHSA-q2hr-2g5m-vwhr](https://github.com/advisories/GHSA-q2hr-2g5m-vwhr), a quadratic-time denial of service in a development-only dependency pulled in by `minimatch`. `@eslint/css` moves to 2.0.0 and `prettier` to 3.9.9.
19
+ - [View full v2.0.4 Changelog](https://github.com/CLDMV/holdmytask/blob/master/docs/changelog/v2/v2.0.4.md)
20
+
21
+ ### Recent Releases
22
+
23
+ - **v2.0.3** (October 2026) — Development toolchain moves to vitest 5; bundle-size and v4 workflow updates; verbatim Apache-2.0 license text ([Changelog](https://github.com/CLDMV/holdmytask/blob/master/docs/changelog/v2/v2.0.3.md))
24
+ - **v2.0.2** (September 2026) — Development dependency update (`@humanfs/node`); no other changes ([Changelog](https://github.com/CLDMV/holdmytask/blob/master/docs/changelog/v2/v2.0.2.md))
25
+ - **v2.0.1** (September 2026) — Fix: a task's timeout timer is now cleared when the task fails or is cancelled ([Changelog](https://github.com/CLDMV/holdmytask/blob/master/docs/changelog/v2/v2.0.1.md))
26
+ - **v2.0.0** (August 2026) — `HoldMyTask` and its aliases are the real class again (breaking for code adapted to v1.6.1's factories); scheduler deadlock fix; `holdmytask-dev` export condition ([Changelog](https://github.com/CLDMV/holdmytask/blob/master/docs/changelog/v2/v2.0.0.md))
27
+
13
28
  ## ✨ Features
14
29
 
15
30
  - **Smart scheduling** - Dynamic timeout-based scheduling for optimal performance
package/index.cjs CHANGED
@@ -21,11 +21,20 @@
21
21
  *
22
22
  * @module holdmytask
23
23
  */
24
+ "use strict";
24
25
 
25
- const { createRequire } = require("module");
26
- const requireESM = createRequire(__filename);
26
+ // index.cjs is a thin wrapper: it loads index.mjs through Node's synchronous require(esm).
27
+ // Node.js versions without require(esm) would fail with a bare ERR_REQUIRE_ESM, so fail
28
+ // early with a message that says what to do instead.
29
+ if (!process.features?.require_module) {
30
+ const error = new Error(
31
+ `@cldmv/holdmytask: require() needs Node.js ^20.19.0 or >=22.12.0 (this is ${process.version}). On older Node.js, load the package with import() instead.`
32
+ );
33
+ error.code = "ERR_REQUIRE_ESM";
34
+ throw error;
35
+ }
27
36
 
28
- const { HoldMyTask } = requireESM("./index.mjs");
37
+ const { HoldMyTask } = require("./index.mjs");
29
38
 
30
39
  // Export main class
31
40
  module.exports = HoldMyTask; // Default export
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cldmv/holdmytask",
3
- "version": "2.0.3",
3
+ "version": "2.0.4",
4
4
  "description": "A tiny task queue that waits until your task is ready",
5
5
  "main": "./index.cjs",
6
6
  "module": "./index.mjs",
@@ -24,12 +24,13 @@
24
24
  "node": ">=18.12"
25
25
  },
26
26
  "scripts": {
27
- "test": "node tests/run-vitest.mjs",
27
+ "test": "node tests/run-vitest.mjs && npm run test:cjs",
28
+ "test:cjs": "node --conditions=holdmytask-dev --test tests/cjs/entry.test.cjs",
28
29
  "test:watch": "vitest --config .configs/vitest.config.mjs",
29
30
  "test:run": "vitest run",
30
31
  "test:coverage": "vitest run --coverage",
31
32
  "test:types": "tsc --noEmit --project .configs/tsconfig.dts.jsonc",
32
- "coverage": "node tests/run-vitest.mjs --coverage-quiet",
33
+ "coverage": "node tests/run-vitest.mjs --coverage-quiet && npm run test:cjs",
33
34
  "ci:coverage": "npm run coverage",
34
35
  "lint": "eslint --config .configs/eslint.config.mjs .",
35
36
  "lint:fix": "eslint --config .configs/eslint.config.mjs . --fix",
@@ -84,7 +85,7 @@
84
85
  "@cldmv/configs": "^1.2.0",
85
86
  "@cldmv/fix-headers": "^2.1.1",
86
87
  "@cldmv/vitest-runner": "^1.2.0",
87
- "@eslint/css": "^1.4.0",
88
+ "@eslint/css": "^2.0.0",
88
89
  "@eslint/js": "^10.0.1",
89
90
  "@eslint/json": "^2.0.1",
90
91
  "@eslint/markdown": "^8.0.3",