Import ES modules without cache. Current stable version is 0.4.0, released in 2025. This library intercepts Node.js module loading via hooks to bypass the ESM cache, ensuring fresh imports for every call. It also clears CommonJS cache with clearRequireCache(). Compared to alternatives like clear-module or decache, it supports ES modules natively and handles dependency chains without caching. Requires Node.js ^22.18.0 or >=24.0.0. Not supported on Deno; Yarn PnP requires Node >=24.
npm install import-without-cacheNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates importing ES modules without cache using both import attributes and no-cache:// protocol, plus clearing CommonJS cache.
Upgrade Node.js to version 22.18.0 or later, or 24.0.0 or later.
Use Node.js >=24.0.0 with Yarn PnP, or use a different package manager (npm/pnpm).
Do not use this package with Deno; consider alternative cache-busting methods.
Call clearRequireCache() after init to clear CommonJS require cache if needed.
On Bun, skip calling init() and only use clearRequireCache() if needed.
Use dynamic import() instead of require() for ESM modules, or upgrade to Node.js >=24.13.1.
Call init() at the start of your application before any no-cache:// import.
Ensure you are running Node.js ^22.18.0 or >=24.0.0, and that the imported module is ESM.
Use named imports matching the module's exports. This is unrelated to cache busting; ensure the module exists.
Check isSupported before using init, and only call if true. Do not use on unsupported platforms.
No dependency data recorded yet.