stealthy-require v1.1.1 is a Node.js library that bypasses the require cache to load fresh module instances. It works by clearing the cache, executing a callback where you require the module, then restoring the cache. Key differentiators: it handles nested dependencies (deep cache bypass), supports exceptions for specific submodules, and provides a workaround for Browserify. However, it cannot re-require native modules, and only bypasses the cache synchronously. The library is stable but sees infrequent updates (last release 2016-2017).
npm install stealthy-requireNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates basic usage and usage with exception callback to bypass the require cache for a module and its dependencies except specified ones.
Only use stealthy-require for non-native modules. Native modules cannot be required twice.
Ensure that the module you bypass does not lazy-load other modules after initial require.
Manually clean up module.children or use a module reinitialization pattern that avoids accumulating references.
Run 'npm install stealthy-require' and ensure require('stealthy-require') is used.Use const stealthyRequire = require('stealthy-require').default or require('stealthy-require') as shown in docs.In Browserify, pass arguments[5] instead of require.cache.
Wrap your callback to handle errors and ensure cache restoration, or use a try-finally block.
No dependency data recorded yet.