3 <title>npm-cache</title>
4 <meta http-equiv="content-type" value="text/html;utf-8">
5 <link rel="stylesheet" type="text/css" href="../../static/style.css">
9 <h1><a href="../cli/npm-cache.html">npm-cache</a></h1> <p>Manipulates packages cache</p>
11 <h2 id="SYNOPSIS">SYNOPSIS</h2>
13 <pre><code>npm cache add <tarball file>
14 npm cache add <folder>
15 npm cache add <tarball url>
16 npm cache add <name>@<version>
18 npm cache ls [<path>]
20 npm cache clean [<path>]</code></pre>
22 <h2 id="DESCRIPTION">DESCRIPTION</h2>
24 <p>Used to add, list, or clear the npm cache folder.</p>
27 Add the specified package to the local cache. This command is primarily
28 intended to be used internally by npm, but it can provide a way to
29 add data to the local installation cache explicitly.</p></li><li><p>ls:
30 Show the data in the cache. Argument is a path to show in the cache
31 folder. Works a bit like the <code>find</code> program, but limited by the
32 <code>depth</code> config.</p></li><li><p>clean:
33 Delete data out of the cache folder. If an argument is provided, then
34 it specifies a subpath to delete. If no argument is provided, then
35 the entire cache is cleared.</p></li></ul>
37 <h2 id="DETAILS">DETAILS</h2>
39 <p>npm stores cache data in the directory specified in <code>npm config get cache</code>.
40 For each package that is added to the cache, three pieces of information are
41 stored in <code>{cache}/{name}/{version}</code>:</p>
44 A folder containing the package contents as they appear in the tarball.</li><li>.../package.json:
45 The package.json file, as npm sees it, with overlays applied and a _id attribute.</li><li>.../package.tgz:
46 The tarball for that version.</li></ul>
48 <p>Additionally, whenever a registry request is made, a <code>.cache.json</code> file
49 is placed at the corresponding URI, to store the ETag and the requested
52 <p>Commands that make non-essential registry requests (such as <code>search</code> and
53 <code>view</code>, or the completion scripts) generally specify a minimum timeout.
54 If the <code>.cache.json</code> file is younger than the specified timeout, then
55 they do not make an HTTP request to the registry.</p>
57 <h2 id="CONFIGURATION">CONFIGURATION</h2>
59 <h3 id="cache">cache</h3>
61 <p>Default: <code>~/.npm</code> on Posix, or <code>%AppData%/npm-cache</code> on Windows.</p>
63 <p>The root cache folder.</p>
65 <h2 id="SEE-ALSO">SEE ALSO</h2>
67 <ul><li><a href="../files/npm-folders.html">npm-folders(5)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li><li><a href="../cli/npm-install.html">npm-install(1)</a></li><li><a href="../cli/npm-publish.html">npm-publish(1)</a></li><li><a href="../cli/npm-pack.html">npm-pack(1)</a></li></ul>
69 <p id="footer">npm-cache — npm@1.3.13</p>
72 var wrapper = document.getElementById("wrapper")
73 var els = Array.prototype.slice.call(wrapper.getElementsByTagName("*"), 0)
74 .filter(function (el) {
75 return el.parentNode === wrapper
76 && el.tagName.match(/H[1-6]/)
80 , toc = document.createElement("ul")
81 toc.innerHTML = els.map(function (el) {
82 var i = el.tagName.charAt(1)
92 out += "<li><a href='#" + el.id + "'>" +
93 ( el.innerText || el.text || el.innerHTML)
98 document.body.appendChild(toc)