From e84d5750b6976e44e13fc540575be8d63a7b937e Mon Sep 17 00:00:00 2001 From: Max Black Date: Wed, 19 Nov 2025 13:33:15 -0800 Subject: [PATCH] docs(cache): add practical examples for npm cache commands --- docs/lib/content/commands/npm-cache.md | 32 ++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/docs/lib/content/commands/npm-cache.md b/docs/lib/content/commands/npm-cache.md index 55835d23e1c92..6becf8385d2f4 100644 --- a/docs/lib/content/commands/npm-cache.md +++ b/docs/lib/content/commands/npm-cache.md @@ -63,6 +63,38 @@ The primary guarantee that the cache makes is that, if it does return data, that To run an offline verification of existing cache contents, use `npm cache verify`. +### Examples + +Verify the cache and clean up any corrupted data: + +```bash +npm cache verify +``` + +Clean the entire cache (requires `--force`): + +```bash +npm cache clean --force +``` + +List all packages in the npx cache: + +```bash +npm cache npx ls +``` + +Remove a specific package from the npx cache: + +```bash +npm cache npx rm create-react-app +``` + +Get detailed information about a package in the npx cache: + +```bash +npm cache npx info cowsay +``` + ### Configuration