
Research
/Security News
Bitwarden CLI Compromised in Ongoing Checkmarx Supply Chain Campaign
Bitwarden CLI 2026.4.0 was compromised in the Checkmarx supply chain campaign after attackers abused a GitHub Action in Bitwarden’s CI/CD pipeline.
import-fresh
Advanced tools
Import a module while bypassing the cache
Useful for testing purposes when you need to freshly import a module.
npm install import-fresh
// foo.js
let count = 0;
export default function increment() {
count += 1;
return count;
}
import createImportFresh from 'import-fresh';
const importFresh = createImportFresh(import.meta.url);
const {default: increment} = await importFresh('./foo.js');
increment();
//=> 1
increment();
//=> 2
const {default: freshIncrement} = await importFresh('./foo.js');
freshIncrement();
//=> 1
Returns an importFresh function bound to parentURL.
parentURL must be a valid hierarchical URL string (for example import.meta.url) or a URL instance.
Type: object
The options are process-global. Every call in the same process must use the same skipNodeModules value.
Type: boolean
Default: false
When true, modules inside node_modules directories are not cache-busted. This means that dependencies from npm packages will share state across fresh imports, which can be useful when you only want to freshly import your own code.
The function returned by createImportFresh.
Type: object
Type: object
Import attributes passed to import(). Each value must be a string. JSON modules are automatically imported with {type: 'json'} when the specifier ends with .json.
Intended for development usage only. Repeated calls grow the ESM module cache because each call uses a unique cache-busting URL. This is an unavoidable “memory leak” and not considered a vulnerability.
Proxyquire is a package that allows you to override dependencies during testing. It provides a way to stub out modules similar to import-fresh, but with an emphasis on mocking for testing purposes.
Decache is a package that lets you delete modules from the require cache. It is similar to import-fresh in that it allows for modules to be re-required as if they were never cached, but it does not provide a direct method to re-import a module.
Clear-require is a package that clears a module from the require cache. It is similar to import-fresh, but instead of re-importing the module, it simply clears it from the cache, requiring an additional call to 'require' to reload the module.
FAQs
Import a module while bypassing the cache
The npm package import-fresh receives a total of 100,398,341 weekly downloads. As such, import-fresh popularity was classified as popular.
We found that import-fresh 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
Bitwarden CLI 2026.4.0 was compromised in the Checkmarx supply chain campaign after attackers abused a GitHub Action in Bitwarden’s CI/CD pipeline.

Research
/Security News
Docker and Socket have uncovered malicious Checkmarx KICS images and suspicious code extension releases in a broader supply chain compromise.

Product
Stay on top of alert changes with filtered subscriptions, batched summaries, and notification routing built for triage.