
Research
/Security News
77 Firefox Extensions Linked to Crypto Wallet and Credential Theft
Socket uncovered 77 linked Firefox extensions, including 40 that steal wallet secrets or credentials and 37 deceptive sports-score shells.
clear-module
Advanced tools
Clear a module from the cache
Useful for testing purposes when you need to freshly import a module.
$ npm install clear-module
// foo.js
let i = 0;
module.exports = () => ++i;
const clearModule = require('clear-module');
require('./foo')();
//=> 1
require('./foo')();
//=> 2
clearModule('./foo');
require('./foo')();
//=> 1
Type: string
What you would use with require().
Clear all modules from the cache.
Clear all matching modules from the cache.
Type: RegExp
Regex to match against the module IDs.
The decache package provides similar functionality by allowing you to remove a module from the require cache. It is straightforward to use and offers a simple API for clearing modules. Compared to clear-module, decache is more focused on single module clearing and does not provide built-in support for clearing multiple or all modules.
The require-reload package allows you to require a module and always get a fresh instance of it. Unlike clear-module, which clears the cache and then requires the module, require-reload handles the re-requiring internally, making it a bit more convenient for certain use cases.
Proxyquire is a more advanced tool that allows you to mock dependencies when requiring modules. While it can be used to achieve similar results to clear-module by mocking and re-requiring modules, it is more complex and offers a broader range of functionalities, including dependency injection and mocking.
FAQs
Clear a module from the cache
The npm package clear-module receives a total of 589,640 weekly downloads. As such, clear-module popularity was classified as popular.
We found that clear-module demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Socket uncovered 77 linked Firefox extensions, including 40 that steal wallet secrets or credentials and 37 deceptive sports-score shells.

Security News
NIST disclosed an unreleased AI tool called V-etalon and opened a broad inquiry into NVD modernization after years of automation plans produced no public enrichment system.

Security News
In his AI Council 2026 talk, Feross Aboukhadijeh covers recent package compromises, vulnerability discovery, and a more automated security model.