Merge remote-tracking branch 'upstream/v0.10'
[platform/upstream/nodejs.git] / deps / npm / html / doc / cli / npm-cache.html
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   <link rel="canonical" href="https://www.npmjs.org/doc/cli/npm-cache.html">
7   <script async=true src="../../static/toc.js"></script>
8
9   <body>
10     <div id="wrapper">
11
12 <h1><a href="../cli/npm-cache.html">npm-cache</a></h1> <p>Manipulates packages cache</p>
13
14 <h2 id="SYNOPSIS">SYNOPSIS</h2>
15
16 <pre><code>npm cache add &lt;tarball file&gt;
17 npm cache add &lt;folder&gt;
18 npm cache add &lt;tarball url&gt;
19 npm cache add &lt;name&gt;@&lt;version&gt;
20
21 npm cache ls [&lt;path&gt;]
22
23 npm cache clean [&lt;path&gt;]</code></pre>
24
25 <h2 id="DESCRIPTION">DESCRIPTION</h2>
26
27 <p>Used to add, list, or clear the npm cache folder.</p>
28
29 <ul><li><p>add:
30 Add the specified package to the local cache.  This command is primarily
31 intended to be used internally by npm, but it can provide a way to
32 add data to the local installation cache explicitly.</p></li><li><p>ls:
33 Show the data in the cache.  Argument is a path to show in the cache
34 folder.  Works a bit like the <code>find</code> program, but limited by the
35 <code>depth</code> config.</p></li><li><p>clean:
36 Delete data out of the cache folder.  If an argument is provided, then
37 it specifies a subpath to delete.  If no argument is provided, then
38 the entire cache is cleared.</p></li></ul>
39
40 <h2 id="DETAILS">DETAILS</h2>
41
42 <p>npm stores cache data in the directory specified in <code>npm config get cache</code>.
43 For each package that is added to the cache, three pieces of information are
44 stored in <code>{cache}/{name}/{version}</code>:</p>
45
46 <ul><li>.../package/:
47 A folder containing the package contents as they appear in the tarball.</li><li>.../package.json:
48 The package.json file, as npm sees it, with overlays applied and a _id attribute.</li><li>.../package.tgz:
49 The tarball for that version.</li></ul>
50
51 <p>Additionally, whenever a registry request is made, a <code>.cache.json</code> file
52 is placed at the corresponding URI, to store the ETag and the requested
53 data.</p>
54
55 <p>Commands that make non-essential registry requests (such as <code>search</code> and
56 <code>view</code>, or the completion scripts) generally specify a minimum timeout.
57 If the <code>.cache.json</code> file is younger than the specified timeout, then
58 they do not make an HTTP request to the registry.</p>
59
60 <h2 id="CONFIGURATION">CONFIGURATION</h2>
61
62 <h3 id="cache">cache</h3>
63
64 <p>Default: <code>~/.npm</code> on Posix, or <code>%AppData%/npm-cache</code> on Windows.</p>
65
66 <p>The root cache folder.</p>
67
68 <h2 id="SEE-ALSO">SEE ALSO</h2>
69
70 <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>
71 </div>
72
73 <table border=0 cellspacing=0 cellpadding=0 id=npmlogo>
74 <tr><td style="width:180px;height:10px;background:rgb(237,127,127)" colspan=18>&nbsp;</td></tr>
75 <tr><td rowspan=4 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td><td style="width:40px;height:10px;background:#fff" colspan=4>&nbsp;</td><td style="width:10px;height:10px;background:rgb(237,127,127)" rowspan=4>&nbsp;</td><td style="width:40px;height:10px;background:#fff" colspan=4>&nbsp;</td><td rowspan=4 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td><td colspan=6 style="width:60px;height:10px;background:#fff">&nbsp;</td><td style="width:10px;height:10px;background:rgb(237,127,127)" rowspan=4>&nbsp;</td></tr>
76 <tr><td colspan=2 style="width:20px;height:30px;background:#fff" rowspan=3>&nbsp;</td><td style="width:10px;height:10px;background:rgb(237,127,127)" rowspan=3>&nbsp;</td><td style="width:10px;height:10px;background:#fff" rowspan=3>&nbsp;</td><td style="width:20px;height:10px;background:#fff" rowspan=4 colspan=2>&nbsp;</td><td style="width:10px;height:20px;background:rgb(237,127,127)" rowspan=2>&nbsp;</td><td style="width:10px;height:10px;background:#fff" rowspan=3>&nbsp;</td><td style="width:20px;height:10px;background:#fff" rowspan=3 colspan=2>&nbsp;</td><td style="width:10px;height:10px;background:rgb(237,127,127)" rowspan=3>&nbsp;</td><td style="width:10px;height:10px;background:#fff" rowspan=3>&nbsp;</td><td style="width:10px;height:10px;background:rgb(237,127,127)" rowspan=3>&nbsp;</td></tr>
77 <tr><td style="width:10px;height:10px;background:#fff" rowspan=2>&nbsp;</td></tr>
78 <tr><td style="width:10px;height:10px;background:#fff">&nbsp;</td></tr>
79 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
80 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
81 </table>
82 <p id="footer">npm-cache &mdash; npm@1.4.8</p>
83