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

verdaccio-keep-private

v1.0.0

Published

一个用于清理 Verdaccio 缓存同时保留私有包的CLI工具。

Readme

简体中文 | English

Verdaccio Keep Private

NPM version License

一个用于清理 Verdaccio 缓存同时保留私有包的CLI工具。

✨ 特性

  • 安全第一: 默认只读扫描,需明确参数才会执行删除操作。
  • 智能识别: 通过 _uplinks 字段准确区分私有包和缓存包。
  • 多种模式: 支持直接确认、交互式确认等多种删除模式。
  • 零依赖: 使用 Node.js 原生 API,无需安装额外依赖。
  • 自动清理: 删除缓存包后,会自动清理产生的空目录。

🚀 安装与使用

最简单的方式是使用 npx,无需全局安装。

npx verdaccio-keep-private <verdaccio-storage-path> [options]

📖 使用说明

命令

verdaccio-keep-private <path> [options]

参数

  • <path>: 必需. Verdaccio 的 storage 目录的绝对或相对路径。

选项

  • --confirm: 直接删除所有扫描到的缓存包,无二次确认。
  • --interactive: 进入交互模式,手动确认是否执行删除操作。
  • -h, --help: 显示帮助信息。

📝 示例

假设你的 Verdaccio storage 目录位于 /path/to/verdaccio/storage

1. 扫描并预览 (安全模式)

只扫描目录,列出将要保留的私有包和可以删除的缓存包,不执行任何删除操作。

npx verdaccio-keep-private /path/to/verdaccio/storage

2. 交互式删除

扫描后,会提示你确认是否删除所有缓存包。

npx verdaccio-keep-private /path/to/verdaccio/storage --interactive

# 程序会提问:
# 确定要删除 XX 个缓存包吗? (y/N): y
# ...开始删除...

3. 直接删除 (请谨慎使用)

扫描后,直接删除所有缓存包,没有确认环节。建议在执行前先进行备份。

npx verdaccio-keep-private /path/to/verdaccio/storage --confirm

⚠️ 注意事项

  1. 备份: 在运行任何删除操作前,强烈建议先备份您的 Verdaccio storage 目录。
  2. 停止服务: 为避免文件占用或数据不一致,建议在清理时停止 Verdaccio 服务。
  3. 权限: 确保执行此工具的用户对 storage 目录有足够的读写权限。

📄 许可证

ISC