NPM-CACHE(3)

πŸ“¦ version 1.2.1, in nixos 26.05, nixpkgs unstable

πŸ’– NAME πŸ’–

okay so this little section-3 icon is npm-cache: it's how you manage the npm cache programmatically, bestie. no cap, that's the whole NAME moment. 🫢

✨ SYNOPSIS ✨

npm.commands.cache([args], callback)

// helpers
npm.commands.cache.clean([args], callback)
npm.commands.cache.add([args], callback)
npm.commands.cache.read(name, version, forceBypass, callback)

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so npm-cache acts much the same ways as the npm help cache command line functionality. lowkey it's the programmatic bestie of that CLI vibe. πŸ’…

the callback is called with the package.json data of the thing that is eventually added to or read from the cache. that part is important β€” that's the data you're getting back. πŸŽ€

🌈 public interface energy

the top level npm.commands.cache(...) functionality is a public interface, and like all commands on the npm.commands object, it will match the command line behavior exactly. iconic, honestly. ⭐

⚠️ internal API warning

however, the cache folder structure and the cache helper functions are considered internal API surface, and as such, may change in future releases of npm, potentially without warning or significant version incrementation.

⚠️ Use at your own risk, bestie. this is not the stable-and-snuggly part of the API. πŸ’€

that's the page, bb β€” it's the March 2017 NPM-CACHE(3) edition, so go forth and cache responsibly. πŸ’–βœ¨

πŸ“¦ where this page comes from