The data contained in this repository can be downloaded to your computer using one of several clients.
Please see the documentation of your version control software client for more information.
Please select the desired protocol below to get the URL.
This URL has Read-Only access.
main_repo / deps / npm / html / doc / cli / npm-cache.html @ 5e865191
History | View | Annotate | Download (3.54 KB)
1 |
<!doctype html>
|
---|---|
2 |
<html>
|
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"> |
6 |
|
7 |
<body>
|
8 |
<div id="wrapper"> |
9 |
<h1><a href="../cli/npm-cache.html">npm-cache</a></h1> <p>Manipulates packages cache</p> |
10 |
|
11 |
<h2 id="SYNOPSIS">SYNOPSIS</h2> |
12 |
|
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> |
17 |
|
18 |
npm cache ls [<path>] |
19 |
|
20 |
npm cache clean [<path>]</code></pre> |
21 |
|
22 |
<h2 id="DESCRIPTION">DESCRIPTION</h2> |
23 |
|
24 |
<p>Used to add, list, or clear the npm cache folder.</p> |
25 |
|
26 |
<ul><li><p>add: |
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> |
36 |
|
37 |
<h2 id="DETAILS">DETAILS</h2> |
38 |
|
39 |
<p>npm stores cache data in <code>$HOME/.npm</code>. For each package that is added |
40 |
to the cache, three pieces of information are stored in |
41 |
<code>{cache}/{name}/{version}</code>:</p> |
42 |
|
43 |
<ul><li>.../package/: |
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> |
47 |
|
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 |
50 |
data.</p>
|
51 |
|
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>
|
56 |
|
57 |
<h2 id="CONFIGURATION">CONFIGURATION</h2> |
58 |
|
59 |
<h3 id="cache">cache</h3> |
60 |
|
61 |
<p>Default: <code>$HOME/.npm</code> on Posix, or <code>$HOME/npm-cache</code> on Windows.</p> |
62 |
|
63 |
<p>The root cache folder.</p> |
64 |
|
65 |
<h2 id="SEE-ALSO">SEE ALSO</h2> |
66 |
|
67 |
<ul><li><a href="../misc/npm-folders.html">npm-folders(7)</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> |
68 |
</div>
|
69 |
<p id="footer">npm-cache — npm@1.3.4</p> |
70 |
<script>
|
71 |
;(function () {
|
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]/)
|
77 |
&& el.id
|
78 |
})
|
79 |
var l = 2
|
80 |
, toc = document.createElement("ul")
|
81 |
toc.innerHTML = els.map(function (el) {
|
82 |
var i = el.tagName.charAt(1)
|
83 |
, out = ""
|
84 |
while (i > l) {
|
85 |
out += "<ul>"
|
86 |
l ++
|
87 |
}
|
88 |
while (i < l) {
|
89 |
out += "</ul>"
|
90 |
l --
|
91 |
}
|
92 |
out += "<li><a href='#" + el.id + "'>" +
|
93 |
( el.innerText || el.text || el.innerHTML)
|
94 |
+ "</a>"
|
95 |
return out
|
96 |
}).join("\n")
|
97 |
toc.id = "toc"
|
98 |
document.body.appendChild(toc)
|
99 |
})()
|
100 |
</script>
|