chore: support Node.js >= 20 (not just 20.11) and test it in CI#538
Merged
Conversation
The ESM build only required Node >= 20.11 because it used import.meta.dirname / import.meta.filename. Replace those with fileURLToPath(import.meta.url) (the CJS build rewrites it to __filename), which works on any ESM-capable Node, and lower engines to >=20 so any Node 20 LTS is supported, not just 20.11+. Also run the unit tests on Node 20, 22 and 24 so the supported range is actually exercised (previously only 22 was tested).
merencia
force-pushed
the
chore/support-node-20
branch
from
June 17, 2026 12:35
e2812a3 to
7271daf
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prep for the 4.3.0 release: make the supported Node.js floor honest and tested.
Why
The ESM build only ran on Node >= 20.11 because of
import.meta.dirname/import.meta.filename(added in 20.11). That excluded early Node 20 LTS (20.0–20.10) for no real reason.Changes
import.meta.dirname/import.meta.filenamewithfileURLToPath(import.meta.url)(works on any ESM-capable Node). The CJS build's replace step rewrites it to__filename, so both builds keep working. Verified by running a real background task on both the ESM and CJS builds.engines.nodeto>=20.The next real floor below this is the timezone code's
IntltimeZoneName: 'shortOffset'(~Node 18, now EOL), so >=20 LTS is the sensible, honest floor.Full suite green (260 tests), build and lint pass.