import-fresh
JSON →Import-fresh bypasses the Node.js module cache to force a fresh import of a module, useful for testing and hot-reloading scenarios. Version 4.0.0 (latest stable, released 2025) requires Node.js ≥22.15 due to its use of ESM module loader hooks. Unlike older cache-clearing approaches (e.g., delete require.cache), import-fresh works with ESM and is the only maintained solution for Node's native ES module system. It uses a unique cache-busting URL per call, which grows memory over time (intended for development only). Sindre Sorhus maintains it with monthly releases.
Resources
packageimport-fresh ↗