New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

cache-cleaner

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

cache-cleaner

Automatically clear development and browser caches (for local dev and browsers).

latest
Source
npmnpm
Version
0.1.1
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

cache-cleaner

A small utility to clear development and browser caches to help speed up iteration and avoid stale assets during local development.

Features

  • Node API: detect and remove common cache/build folders like .next, .vite, dist, build, and node_modules/.cache.
  • Browser API: clear localStorage, sessionStorage, delete IndexedDB (when available), unregister service workers, and optionally hard reload the page.
  • CLI: npx cache-cleaner with options for dry-run and custom folders.

Usage

Node:

import { clearCache } from 'cache-cleaner';

await clearCache(['dist', 'node_modules/.cache']);

Browser:

import { clearBrowserCache } from 'cache-cleaner';

clearBrowserCache({
  clearLocalStorage: true,
  clearSessionStorage: true,
  clearIndexedDB: true,
  unregisterServiceWorkers: true,
  hardReload: true
});

CLI:

npx cache-cleaner

Testing

Run unit tests with:

npm install
npm test

Keywords

cache

FAQs

Package last updated on 05 Nov 2025

Did you know?

Socket

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.

Install

Related posts