Repository navigation
Releases
v2.0.0
@cldmv/wisp v2.0.0 Changelog
Release Date: November 2026
Release Type: Major
Branch: release/2.0.0
Overview
require("@cldmv/wisp") now returns the module object { default, wisp, wispSync }, the same exports import gives you, instead of the wisp function. That is the only change to the public surface, and it only affects CommonJS callers that called the result of require() directly. ESM import is unchanged, and so are the options, the JSON loading behaviour and the supported Node.js range.
Caller detection loses a dead flag and dist/ is now built one minified file per module instead of a tsup bundle, neither of which changes behaviour. The rest of the release is test and CI housekeeping and development-dependency bumps. The package still has no runtime dependencies.
💥 Breaking Changes
The CommonJS entry returns the module object (#86, fixes #85)
src/index.cjs, published as dist/index.cjs, is now the generic CLDMV shim. It loads index.mjs through synchronous require(esm) and hands back what import sees. The ESM entry exports two distinct values, wisp and wispSync (default is wisp), so require("@cldmv/wisp") returns the module object { default, wisp, wispSync } and not the wisp function. Before, the CommonJS entry unwrapped the function, so require("@cldmv/wisp")("./data.json") worked. It now throws, because the module object is not callable.
require(x)(…)becomesrequire(x).wisp(…), orconst { wisp } = require(x)..wisp,.wispSync,.defaultand destructuring keep working.- ESM
importis unchanged.
The require() Node.js range is the same as in v1.0.9: ^20.19.0 or >=22.13.0, with the same ERR_REQUIRE_ESM message pointing at import() on older versions.
🐛 Bug Fixes
- Dead flag removed from caller detection (#89, resolves #12).
pickPrimaryBaseFile()tracked a second flag for leaving a rootindex.*file but never read it. wisp has no rootindex.*file any more, so the only rule is the one the code already used: the first frame after the stack leavessrc/ordist/is the caller. The flag and its eslint-disable are gone and the docstring matches. Behaviour is unchanged, and a new test covers an ESM caller importing the package by name, throughsrc/index.mjsunderwisp-devand throughdist/index.mjsafter a build.
🔧 CI & tooling
npm testalso runs the suite against the build. The newtest:distscript builds the package and runs the Vitest suite with--mode=dist, so the publisheddist/is tested as well assrc/.testandci:coveragecall it (#74).- The
wisp-devcondition is set withdevCondition().test.nodeOptionsis not a Vitest option and passed nothing to the workers. The Vitest configuration now usesdevCondition()from@cldmv/configs1.4.0, which setsresolve.conditions,ssr.resolve.conditionsandtest.execArgv(#72). sync-release-notes.ymladded. The companion workflow syncs release bodies from the per-version changelog files and creates missing version tags (#80).ci.ymlsynced with the v4.43.0 template (#82).dist/is built one file per module. The tsup bundle is replaced byscripts/build.mjs, which minifies eachsrcfile in place with esbuild (bundle: false,keepNames,node16target, source maps written next to the output but left out of the tarball) and copiessrc/index.cjsverbatim.dist/now mirrorssrc/, sodist/index.mjsimportsdist/wisp.mjs, which importsdist/lib/resolve-from-caller.mjs, and every module exists once. Therequire()andimportexport shapes are unchanged. The caller-resolution tests moved fromtests/bundletotests/builtand also check the per-module layout.tsupis gone andesbuildis a dev dependency (#91, resolves #83).- Superseded CI runs on
nextandhotfixesare cancelled, so a new push no longer queues behind runs for commits that have already been replaced. The block is synced with the CLDMV/.github v4.46.0 template (#87, fixes #84).
📚 Documentation
- The README's usage section now says what
require("@cldmv/wisp")returns, and the Contributing section describestestandtest:dist(#86, #74). - NEW: docs/changelog/v2/v2.0.0.md: this changelog.
- README What's New promoted to v2.0.0.
🔧 Dependencies
- Runtime: none, unchanged.
vitestand@vitest/coverage-v85.0.5 → 5.1.0 (#75).@cldmv/fix-headers2.2.4 → 2.2.6 (#76).@cldmv/configs1.3.0 → 1.4.0 (#72).
Upgrade notes
- If you load wisp from CommonJS and call the result of
require()directly, changerequire("@cldmv/wisp")(…)torequire("@cldmv/wisp").wisp(…), or useconst { wisp } = require("@cldmv/wisp"). .wisp,.wispSync,.defaultand destructuring work as before, and ESMimportneeds no change.dist/now has one file per module (dist/index.mjs,dist/wisp.mjs,dist/lib/…) instead of a single bundle. Deep imports intodist/were never supported, and theexportsmap is unchanged.- Nothing changes for the Node.js version:
engines.nodeis still>=16.0.0, andrequire()needs^20.19.0or>=22.13.0.
| Metric | Coverage |
|---|---|
| Statements | 100.0% |
| Branches | 98.9% |
| Functions | 100.0% |
| Lines | 100.0% |
Avg: 99.7% · 96931da · Node lts/*
👥 Contributors
v1.0.9
@cldmv/wisp v1.0.9 Changelog
Release Date: November 2026
Release Type: Patch
Branch: release/1.0.9
Overview
This release renames the CommonJS entry's source file to match its published name and adds tests for caller resolution through it. JSON loading behaves exactly as in v1.0.8: the only change in src/ is the version range named in the require() error message, and the published dist/index.cjs differs only in that message, a comment explaining it and its file header.
The supported Node.js range does not change. engines.node stays >=16.0.0, since wisp exists to load JSON on every Node.js version, and dist/index.mjs is still built for the Node.js 16 syntax level.
📦 Requirements
Node.js support is unchanged; developing wisp needs 22.22.0 (#65, #70)
importworks on Node.js 16 and later, as before.require()needs Node.js^20.19.0or>=22.13.0, because the CommonJS entry loads the ES module build through synchronousrequire(esm). 22.13 rather than 22.12 because Node.js 22.12 prints an ExperimentalWarning onrequire(esm).- The CommonJS entry's
ERR_REQUIRE_ESMmessage now readsrequire() needs Node.js ^20.19.0 or >=22.13.0and still points toimport(). - Developing wisp needs Node.js 22.22.0 or newer, the floor of the build and test toolchain (Vitest 5, tsup 9). That floor is declared in the new
devEngines.runtimefield withonFail: "error", which npm checks only for this project's ownnpm install,npm ciandnpm run, never for consumers (#70). - The CI test matrix starts at Node.js 22.22.0 instead of 22.12.0, matching
devEngines. That is not wisp's support floor, and the workflow input descriptions now say the value must matchdevEngines, notengines(#70).
📦 Packaging
- CommonJS entry renamed in source.
src/cjs-shim.cjsis nowsrc/index.cjs, next to the ESM entrysrc/index.mjsit loads, so the source and the publisheddist/index.cjsshare a name (#65, fixes #63). Thewisp-devexport condition'srequiretarget now points atsrc/index.cjs. Nothing changes for consumers of the published package. - Caller resolution through the CommonJS entry is tested. wisp resolves relative paths from the file that calls it by skipping
index.*entry frames insrc/anddist/. New tests load the package by name from a CommonJS fixture, once with thewisp-devcondition (src/index.cjs) and once without it (dist/index.cjs), and check that paths still resolve against the calling file (#65).
🔒 Security & supply chain
- The dev toolchain update moves Vite (via Vitest) from 8.3.2 to 8.3.5 and esbuild (via tsup) from 0.27.7 to 0.28.2, clearing the open Dependabot alerts (#66).
overridesnow forcekatexto>=0.19.1 <1.0.0(0.16.47 → 0.19.1) andminimatchto^11.0.3(10.2.6 → 11.0.3), the patched versions (#67). Both are development-only transitive dependencies; the package still has no runtime dependencies.
🔧 CI & tooling
- The test setup passes the
wisp-devcondition:resolve.conditionsandssr.resolve.conditionsin the Vitest configuration, and--conditions=wisp-devon thenode --testrun intest:cjs, so loading the package by name in tests reachessrc/(#65). - The failed-import retry test is gated on behaviour, not the Node.js major. Node.js 22.22 retries a URL whose first import failed on its attributes, as 24 and later do, so the old
>= 24check ran the cached-failure test on a Node.js that no longer caches. The suite now probes the behaviour once at startup (#65).
📚 Documentation
- The README's Requirements section states the
require()range (^20.19.0or>=22.13.0) next to the Node.js 16 floor forimportand notes that development needs Node.js 22.22.0 (devEngines), and the Contributing section explains how thewisp-devcondition switches a checkout betweendist/andsrc/(#65, #70). - NEW: docs/changelog/v1/v1.0.9.md: this changelog.
- README What's New promoted to v1.0.9.
🔧 Dependencies
- Runtime: none, unchanged.
- tsup 9:
tsup8.5.1 → 9.0.0 (#66). - Dev toolchain bumps (#66, #49):
vitestand@vitest/coverage-v85.0.3 → 5.0.5,@cldmv/vitest-runner1.5.3 → 1.5.6,eslint10.12.0 → 10.14.0,prettier3.9.9 → 3.9.10,@eslint/css2.0.0 → 2.0.1,@eslint/json2.1.0 → 2.1.1,globals17.13.0 → 17.14.0,@types/node26.6.4 → 26.6.6. - CLDMV tooling (#66):
@cldmv/fix-headers2.2.0 → 2.2.4,@cldmv/configs1.2.4 → 1.3.0,@cldmv/jsonv1.1.3 → 1.1.5,@cldmv/eslint-plugin-jsonv1.0.15 → 1.0.17,@cldmv/prettier-plugin-jsonv1.1.3 → 1.1.4. typescriptstays on^6.0.3, and the generatedtypes/are unchanged.overridesforkatexandminimatch, see Security & supply chain (#67).
Upgrade notes
- Nothing to do for the Node.js version:
engines.nodeis still>=16.0.0. Code that callsrequire()needs Node.js^20.19.0or>=22.13.0; on older versions load the package withimport(). - No API changes: the exports, options and JSON loading behaviour are the same as v1.0.8.
| Metric | Coverage |
|---|---|
| Statements | 100.0% |
| Branches | 100.0% |
| Functions | 100.0% |
| Lines | 100.0% |
Avg: 100.0% · 1aaf6cf · Node lts/*
👥 Contributors
v1.0.8
@cldmv/wisp v1.0.8 Changelog
Release Date: October 2026
Release Type: Patch
Branch: release/1.0.8
Overview
A one-line development-dependency patch: @types/node 26.6.3 → 26.6.4 (#46). The only files that differ from v1.0.7 are package.json (the version number) and package-lock.json. The package.json range ^26.6.2 already allowed the new version, so the lockfile is the only place the bump is recorded.
@types/node is a development dependency used by the TypeScript type check (npm run types:check, part of npm run build:ci). It does not enter the published tarball, which still contains only dist/, types/, README.md and LICENSE, and the package still has no runtime dependencies. With the bump in place npm run build:ci (lint, format check, tsc, the build, the test suite and the type check) passes.
🔧 Dependencies
@types/node26.6.3 → 26.6.4 (#46), a lockfile-only patch update within the existing^26.6.2range. It is the only entry in the lockfile that changed, and its declared dependencies are unchanged.
📚 Documentation
- NEW: docs/changelog/v1/v1.0.8.md: this changelog.
- README What's New promoted to v1.0.8.
Upgrade notes
- No breaking changes and no runtime change: drop-in for v1.0.7.
engines.node(>=16.0.0) is unchanged, and the supported Node.js versions forimportandrequire()are the same.
| Metric | Coverage |
|---|---|
| Statements | 100.0% |
| Branches | 100.0% |
| Functions | 100.0% |
| Lines | 100.0% |
Avg: 100.0% · 3595850 · Node lts/*
👥 Contributors
v1.0.7
Wisp v1.0.7 Changelog
Release Date: October 2026
Release Type: Patch
Branch: release/1.0.7
Overview
Fixes the CommonJS entry point so require("@cldmv/wisp") works inside esbuild and webpack bundles, and makes require() fail with a clear message on Node.js versions that cannot load ES modules synchronously. It also stops a failed validate check from silently loading the fallback file, fixes an endless loop when the fallback itself could not be loaded, and relicenses the package under Apache-2.0.
Two more wisp() fixes for modules loaded through import(): a reviver or validate on a module without a default export now works instead of ending in "Unsupported type", and a validate rejection on any import() path throws the validation error once.
The published package is now built: src/ is bundled with tsup into dist/index.mjs, dist/index.cjs is a thin require() wrapper around it, and the tarball ships only dist/, types/, README.md and LICENSE. The @cldmv/wisp entry points and their exports are unchanged; only code that reached into the package's files directly is affected (see Upgrade notes). The test suite moved from mocha to @cldmv/vitest-runner with 100% coverage, and the standard lint/format setup was added.
🐛 Bug Fixes
require() works in bundles and fails clearly on older Node.js (#30)
index.cjs loaded index.mjs through createRequire(__filename), which bundlers such as esbuild and webpack cannot follow. It now uses the plain require("./index.mjs") that a .cjs file already has in scope.
index.cjs has always depended on Node.js's synchronous require(esm), so require("@cldmv/wisp") never worked on Node.js versions without it. Those versions used to fail with a bare loader error; index.cjs now checks process.features.require_module first and throws an ERR_REQUIRE_ESM error that names the supported versions (^20.19.0 or >=22.12.0) and points to import() instead. import("@cldmv/wisp") keeps working on every Node.js version the package supports.
The exports are the same as before: require("@cldmv/wisp") returns wisp, with .default, .wisp and .wispSync attached. The CommonJS entry now ships as dist/index.cjs (see Packaging below).
A failed validation throws instead of loading the fallback (#35, fixes #33)
wisp and wispSync ran validate inside the same try block as reading and parsing the file, so when the primary file loaded fine but the caller's validate rejected it, wisp fell through to fallback as if the file were missing. The data the caller asked to reject was silently replaced by the fallback's. The fallback is now used only when the primary file cannot be read or parsed (missing, unreadable, or not valid JSON). A validation failure throws, in the same format as before: Failed to load JSON file at <url>: @cldmv/wisp: <message>.
The same change fixes a second bug: the fallback was loaded with the same options, fallback included, so a fallback that also failed to load or validate retried itself forever. wispSync ended with Maximum call stack size exceeded and wisp never settled. The fallback is now loaded without a further fallback and throws if it fails.
reviver and validate work on a module without a default export (#41, fixes #38)
When wisp() loaded a module through import() and was given a reviver or validate, it copied the module's value with structuredClone before handing it over. For a module with no default export that value is the module namespace object, which structuredClone cannot copy. The resulting DataCloneError was swallowed as a failed import strategy, and the call ended in the generic Unsupported type '<type>' or failed to load module at <url> error. wisp() now copies the namespace's exports to a plain object first, so reviver and validate receive a plain-object copy of the module's exports. Without either option the namespace itself is still returned, as before. wispSync only parses JSON files and is not affected.
A validate rejection on an import() path throws the validation error once (#41, fixes #39)
validate ran inside each import() strategy's try block, so a rejection counted as that strategy failing: the next strategy imported the module again and validated it again. For type: "json" the call ended on the file-system path and threw the validation error there, after calling validate up to three times; for any other type it ended in Unsupported type, hiding the validation error entirely. validate now runs once, after the module has loaded, and a rejection throws the same error as the file-system path, Failed to load JSON file at <url>: @cldmv/wisp: <message>, with the original error as cause. The same release refactors the strategy loop to clear a CodeQL js/unused-loop-variable finding; behaviour is unchanged by that part.
📄 License
The package is relicensed from MIT to Apache-2.0 (#34), and the LICENSE file now carries the Apache-2.0 text.
📦 Packaging
- Built
dist/output (#40) — tsup bundlessrc/index.mjsinto a minifieddist/index.mjs(target Node.js 16, function names kept).dist/index.cjsis not a second bundle: it is the CommonJS wrapper from #30, copied in verbatim, and loads./index.mjsthroughrequire(esm). The rootindex.mjs/index.cjsfiles are gone (the sources now live atsrc/index.mjsandsrc/cjs-shim.cjs). filesnow lists onlydist/(without sourcemaps),types/,README.mdandLICENSE.src/and the root entry files are no longer published.exports—importresolves todist/index.mjs,requiretodist/index.cjs, and atypescondition plus top-levelmain,moduleandtypesfields point at the built files and attypes/index.d.mts. Awisp-devcondition servessrc/directly for local development.- Caller-relative path resolution is checked against the built
dist/output, for bothimportandrequire(), by the newtests/bundle/caller-resolution.test.mjs.
🔧 CI & tooling
- Test suite on
@cldmv/vitest-runner(#37) — the mocha + chai suite undertest/moved to vitest undertests/(*.test.vitest.mjs), with new tests for the import strategies and the caller resolver. Coverage is 100% and the coverage badge and PR coverage comment are enabled in CI. The legacyassert-strategy tests run on Node.js 24+, because Node.js 20 and 22 cache a failedimport()of the same URL; older versions check the unsupported-type error instead. - Standard lint/format setup (#36) — prettier and ESLint configs in
.configs/, a.prettierignore,lint/lint:fix/format/format:checkscripts, and a check-only pre-commit hook installed byprepare. - Build scripts (#40) —
buildruns tsup,types:build/types:checkreplacebuild:types,prepackbuilds types anddist/before packing, andbuild:ciruns lint, format check, types, build and tests. CI, publish and release workflows builddist/alongside the types, the coverage jobs runbuild:cibefore measuring, and the bundle-size check measuresdist/index.mjsanddist/index.cjs. BUGS.mdwas reformatted by prettier (code-fence languages and spacing; no content change), and one/* v8 ignore next */comment marks a type check insrc/lib/resolve-from-caller.mjsthat the exported wrappers make unreachable. Neither changes behaviour.- New tests for
wispandwispSync: a primary that fails validation throws without using the fallback, a primary that is invalid JSON uses the fallback, and a fallback that fails validation throws. - New
tests/cjs/entry.test.cjs(run bynpm testthroughnpm run test:cjs, which now buildsdist/first) checks thatrequire()returns the same functions asimport, and that the version check fires whenrequire(esm)is unavailable.
📚 Documentation
- NEW: docs/changelog/v1/ — per-version changelogs for every release from v1.0.0.
- README reorganized; the error-handling example now shows the actual error message, and the
wispSyncreturn type and thetype/fallbackoptions are documented.
🔧 Dependencies
No runtime dependencies were added or changed; the package still has none, and engines.node stays >=16.0.0. All changes are to development dependencies:
- Test toolchain (#37): added
@cldmv/vitest-runner(^1.5.3),vitest(^5.0.3) and@vitest/coverage-v8(^5.0.3); removedmochaandchai. - Build (#40): added
tsup(^8.5.1). - Lint and format (#36): added
prettier(^3.9.9),@eslint/json,@eslint/markdown,@eslint/css,@cldmv/eslint-plugin-jsonv,@cldmv/prettier-plugin-jsonvand@cldmv/jsonv;eslint^10.10.0→^10.12.0andglobals^17.12.0→^17.13.0. @cldmv/fix-headers^2.1.2→^2.2.0(#42 took it to^2.1.4, #44 to^2.2.0). Version 2.1.4 no longer writes a JavaScript comment into JSON or Markdown files, processes every repeated--input, and never walks dependency folders such asnode_modules. Version 2.2.0 makes the@Last modified byheader ...
v1.0.3
Wisp v1.0.3 Changelog
Release Date: August 2026
Release Type: Patch
Overview
A development-dependency security update. No runtime code changed.
This version was tagged on GitHub but was not published to npm; npm went from v1.0.1 to v1.0.5.
🔧 Dependencies
Upgrade notes
- No runtime change — drop-in for v1.0.2.
v1.0.6
Wisp v1.0.6 Changelog
Release Date: October 2026
Release Type: Patch
Overview
Uniform file headers, a CI fix and a development-dependency security update. No runtime code changed; the published .mjs / .cjs files differ only in their header comments.
🔧 CI & tooling
- Adopted the shared CLDMV
@cldmv/fix-headersconfig (npm run fix:headers) and stamped uniform file headers across the source and workflow files (#28). - The in-repo PR mirror job now runs instead of being skipped (#29).
🔧 Dependencies
brace-expansion5.0.9 → 5.0.12 andserialize-javascript7.1.1 → 7.1.2, development-only transitive dependencies (#26).- Added
@cldmv/fix-headersand@cldmv/configsas development dependencies.
Upgrade notes
- No runtime change — drop-in for v1.0.5.
👥 Contributors
v1.0.5
Wisp v1.0.5 Changelog
Release Date: October 2026
Release Type: Patch
Overview
Development toolchain updates (TypeScript 6, chai 6, @types/node 26) and v4 workflow syncs. The only source change is a type-checker cast; runtime behavior is unchanged. This is the first npm release since v1.0.1, so it also delivers the changes from v1.0.2–v1.0.4 to npm.
🔧 CI & tooling
- Synced the v4 workflows with the CLDMV/.github v4.29.2 templates (#20), added the bundle-size workflow measuring the published JS files (#22), and stopped a skipped PR-run mirror job from satisfying the required PR check (#24).
tsconfig.jsonmoved tomodule/moduleResolutionNodeNextfor TypeScript 6. The legacyimport(…, { assert })call insrc/wisp.mjsgained a type cast so the checker accepts theassertkey; the call itself is unchanged.
🔧 Dependencies
typescript^5.2.0 → ^6.0.3 (#21)chai4.5.0 → 6.2.2 (#15)@types/node20.19.24 → 26.6.3 (#18, #23)eslint10.10.0 → 10.11.0 (#17)mocha12.0.1 → 12.0.2 (#16)
All are development dependencies; the package still has no runtime dependencies.
Upgrade notes
- No runtime change — drop-in for v1.0.1 (the previous npm release). See v1.0.4 for the
error.causeaddition that reaches npm with this version.
👥 Contributors
v1.0.4
Wisp v1.0.4 Changelog
Release Date: September 2026
Release Type: Patch
Overview
Wires up ESLint for the first time, keeps the original error attached to the errors wisp throws, and moves the test toolchain to mocha 12.
This version was tagged on GitHub but was not published to npm; npm went from v1.0.1 to v1.0.5.
🐛 Bug Fixes
Errors keep their original cause
Errors thrown by wisp and wispSync (validation failures and "Failed to load JSON file" errors) now pass the underlying error as cause, so error.cause holds the original ENOENT, SyntaxError or validation error. The messages are unchanged.
Lint cleanup
wispSync no longer destructures the type option it never used, and an unused variable was removed from the caller resolver. Neither changes behavior.
🔧 CI & tooling
- ESLint is now actually configured (
.configs/eslint.config.mjs); thelintscript previously pointed at a missing setup. - Added
.github/dependabot.ymltargetingnext, thefeature-pr.ymlauto-PR workflow, and moved the release and feature-PR workflows to the current thin-caller templates (#6). - The hotfix redirector now uses the v4 reusable workflow and signs its security cherry-picks (#8).
- The CI Node.js matrix now runs from 22.12.0 up to 26 (#10).
🔧 Dependencies
mocha^10.2.0 → ^12.0.1, which fixes ESM/CJS interop on Node.js 26 and removes a large set of old transitive dependencies (#9, #10).- Development dependency group update (#5).
- Added
eslint,@eslint/jsandglobalsas development dependencies.
Upgrade notes
- No API changes — drop-in for v1.0.3. Code that inspects
error.causenow gets the original error instead ofundefined.
👥 Contributors
v1.0.2
Wisp v1.0.2 Changelog
Release Date: July 2026
Release Type: Patch
Overview
Moves the repository onto the CLDMV v4 staging-branch release flow. No runtime code changed.
This version was tagged on GitHub but was not published to npm; npm went from v1.0.1 to v1.0.5.
🔧 CI & tooling
- Replaced the old release workflow with the CLDMV v4 workflow set: work merges into
next, a persistent release PR carries it tomaster, andhotfixeshandles urgent fixes (#2). - Added CodeQL, OpenSSF Scorecard, dependency review, CLA, labeler, PR-title normalization, stale, branch-retention, tag-health and release-notification workflows.
Upgrade notes
- No runtime change — drop-in for v1.0.1.
👥 Contributors
v1.0.0
Wisp v1.0.0 Changelog
Release Date: November 2025
Release Type: Major (initial release)
Overview
First public release of @cldmv/wisp, a small library for loading JSON files in Node.js without caring which JSON import syntax the running Node.js version supports.
✨ Features
Version-agnostic JSON loading
wisp(input, options)loads a JSON file asynchronously. It triesimport(url, { with: { type: "json" } })first, then the legacyimport(url, { assert: { type: "json" } }), and finally reads and parses the file withfs.readFile.wispSync(input, options)loads a JSON file synchronously withfs.readFileSync.inputaccepts a relative path, an absolute path, afile://string or aURL. Relative paths resolve from the file that calledwisp/wispSync, unlessoptions.baseis given.- Options:
base(base path or URL for relative inputs),validate(called with the parsed value; a throw rejects the load),reviver(passed toJSON.parse),type(import attribute type,"json"by default, async only) andfallback(a second path or URL to try when the first one cannot be loaded). - Values returned with a
reviverorvalidateare deep-cloned (withstructuredClonewhen available), so the module cache is never mutated.
Packaging
- Dual entry points:
index.mjsforimportandindex.cjsforrequire(), withwispas the default export. - Declared
engines.nodeof>=16.14.
Upgrade notes
- Initial release; nothing to upgrade from.
- Relative-path resolution from the caller's location does not work correctly in this version when the package is installed as a dependency (paths resolve from inside the package). Upgrade to v1.0.1.