npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

sys-cache-clear

v1.4.0

Published

CLI tool to clear temporary and junk files from your system (Windows, with Mac/Linux support planned)

Readme

Give a Star⭐ if you like it

System Cache Cleaner

CLI tool to clear temporary and junk files from your Windows system.

Clears files from known safe locations — Temp folders, Windows Prefetch, and the Recycle Bin — with full control over what gets deleted. Built with extensibility for Mac/Linux support in the future.

Note: Currently supports Windows only. Linux/Mac support is planned.

npm version License: MIT

Requirements

  • Node.js 16 or higher
  • OS: Windows only (Linux/Mac coming in a future release)

Installation

npm install -g sys-cache-clear

Or run directly from the project folder:

npm install
node bin/sys-cache-clear.js --help

Commands

sys-cache-clear list

Lists all known target cache folders without scanning them.

$ sys-cache-clear list

Cache Targets

  temp           C:\Users\You\AppData\Local\Temp
  prefetch       C:\Windows\Prefetch
  recyclebin     Windows Recycle Bin

sys-cache-clear scan

Read-only scan. Shows file count and total size for each target folder. Does not delete anything.

$ sys-cache-clear scan

Scan Results

  ✔ temp scanned
    📁 temp — 1,247 files, 523.41 MB
  ⚠ Skipping "prefetch" — requires Administrator privileges.

  Total: 1,247 files, 523.41 MB

sys-cache-clear clean

Scans all targets, shows a summary, asks for confirmation, then deletes files.

$ sys-cache-clear clean

Scanning targets...

  ✔ temp — 1,247 files, 523.41 MB

  Found 1,247 files (523.41 MB) across 1 target(s).

? Delete 1,247 files (523.41 MB) from 1 target(s)? (y/N)

Options

| Flag | Description | |------|-------------| | --yes, -y | Skip the confirmation prompt | | --dry-run | Show exactly what would be deleted, but don't delete anything | | --target <name> | Only clean a specific target (e.g. temp or prefetch) | | --exclude <pattern> | Exclude files matching a glob pattern (repeatable) | | --verbose | Show full skipped file list with paths and raw error codes |

Glob patterns: --exclude uses standard glob syntax. * matches any sequence of characters. Patterns are matched against filenames (not full paths). Examples: "*.exe", "antigravity*", "*.log".

Examples

# Skip confirmation
sys-cache-clear clean --yes

# Preview what would be deleted
sys-cache-clear clean --dry-run

# Clean only the temp folder
sys-cache-clear clean --target temp

# Clean prefetch (requires Administrator)
sys-cache-clear clean --target prefetch

# Exclude specific files/patterns from deletion
sys-cache-clear clean --exclude "*.exe" --exclude "antigravity*"

# Combine flags: dry-run with exclusions
sys-cache-clear clean --dry-run --exclude "*.log"

# Empty only the Recycle Bin
sys-cache-clear clean --target recyclebin

sys-cache-clear --version

Prints the current version.

sys-cache-clear --help

Shows help text with all available commands and options.

Scheduling (Windows Only)

You can set up sys-cache-clear to run automatically in the background using Windows Task Scheduler. Automated runs happen at 3:00 AM and will automatically use --yes so no prompts are shown.

sys-cache-clear schedule --daily

Schedules the cleaner to run every day at 3:00 AM.

sys-cache-clear schedule --weekly

Schedules the cleaner to run every Sunday at 3:00 AM.

sys-cache-clear schedule --status

Shows if a task is currently scheduled, its frequency, and when it will run next.

sys-cache-clear schedule --remove

Removes the scheduled task.

Administrator Privileges: You do NOT need Administrator privileges to create a basic scheduled task. However, if you create the task without Administrator rights, the task will not be able to clean the Prefetch folder. To ensure Prefetch is cleaned during scheduled runs, open an elevated terminal (Run as Administrator) and run sys-cache-clear schedule --daily.

Logs: Since scheduled tasks run silently in the background, you can check what was deleted by opening the log file located at: %APPDATA%\sys-cache-clear\schedule.log

Prefetch & Administrator

The Windows Prefetch folder (C:\Windows\Prefetch) requires Administrator privileges to access. If you run sys-cache-clear without elevation, Prefetch will be skipped automatically with a warning message. To include it:

  1. Open Command Prompt or PowerShell as Administrator
  2. Run sys-cache-clear clean

Staying Updated

sys-cache-clear checks for updates automatically and will notify you when a new version is available on npm.

Targets

| Name | Path | Notes | |------|------|-------| | temp | %TEMP% | User's temp folder | | tmp | %TMP% | Only included if different from %TEMP% | | prefetch | %WINDIR%\Prefetch | Requires admin | | recyclebin | Windows Recycle Bin | Emptied via PowerShell |

The tool never touches folders outside this defined list.

Project Structure

sys-cache-clear/
├── bin/
│   └── sys-cache-clear.js    # CLI entry point (commander)
├── src/
│   ├── targets.js       # OS-specific target definitions
│   ├── scanner.js       # Recursive file scanner
│   ├── cleaner.js       # File deletion with per-file error handling
│   ├── prompt.js        # Confirmation prompt (inquirer)
│   ├── logger.js        # Colored output (chalk)
│   └── utils.js         # formatBytes, isAdmin
├── package.json
└── README.md

Safety

  • No guessing: Only explicitly defined target folders are ever touched.
  • Per-file try/catch: A single locked or permission-denied file is skipped — it never crashes the operation.
  • Dry-run support: Always preview before deleting with --dry-run.
  • Confirmation by default: The clean command asks before deleting unless --yes is passed.

Contributing

Found a bug or have a suggestion? Open an issue or submit a pull request on GitHub.

License

MIT

Links