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