Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

flush-cache

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flush-cache - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

4

index.js

@@ -5,4 +5,6 @@ 'use strict'

for (const item of Object.keys(require.cache)) {
delete require.cache[item]
if (!item.includes('deasync')) {
delete require.cache[item]
}
}
}
{
"name": "flush-cache",
"version": "1.0.0",
"version": "1.0.1",
"description": "Flushes the internal node cache, useful (and recommended) when testing apps",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -9,2 +9,16 @@ # flush-cache

## usage
### install
We'll install and save flush-cache so we can use it locally for our tests:
```
npm i flush-cache --save-dev
```
or, if you use [yarn](https://yarnpkg.com/):
```
yarn add flush-cache --dev
```
### common

@@ -19,3 +33,3 @@

app.js
test.js
```js

@@ -32,2 +46,5 @@ const flush = require('flush-cache')

flush-cache deletes every require cache object, so when you require modules
recursively, their cache gets flushed too.
## examples

@@ -75,1 +92,9 @@ ### mocha

```
## gotchas
Most modules expect the `require` command to always be cached, so some modules
may break. If you detect modules which break this module, create an issue or a
PR.
Current require caches which are ignored:
- deasync
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc