require-again
JSON →require-again is a lightweight Node.js utility that clears the require cache for a given module path, allowing you to re-require it with fresh state. This is particularly useful in unit tests where you need to test code that behaves differently based on environment variables or other runtime conditions (e.g., NODE_ENV). The package is version 2.0.0, last updated with support for Node.js 4-6. Unlike other cache-busting tools (like decache or rerand), require-again re-adds the module back to the cache after re-requiring, so subsequent normal requires return the cached version. It has zero dependencies and a minimal API.
Traffic · last 30 days stale · no recent hits
total hits 8
actors 1 distinct systems
last hit 20d ago human
top countries 🇸🇬 Singapore · 🇺🇸 United States · AR · 🇮🇹 Italy
Resources
packagerequire-again ↗