summaryrefslogtreecommitdiff
path: root/deps/npm/html/doc/cli/npm-cache.html
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/html/doc/cli/npm-cache.html')
-rw-r--r--deps/npm/html/doc/cli/npm-cache.html61
1 files changed, 34 insertions, 27 deletions
diff --git a/deps/npm/html/doc/cli/npm-cache.html b/deps/npm/html/doc/cli/npm-cache.html
index 1d78e738c2..fdcf223638 100644
--- a/deps/npm/html/doc/cli/npm-cache.html
+++ b/deps/npm/html/doc/cli/npm-cache.html
@@ -16,10 +16,10 @@ npm cache add <folder>
npm cache add <tarball url>
npm cache add <name>@<version>
-npm cache ls [<path>]
-
npm cache clean [<path>]
aliases: npm cache clear, npm cache rm
+
+npm cache verify
</code></pre><h2 id="description">DESCRIPTION</h2>
<p>Used to add, list, or clean the npm cache folder.</p>
<ul>
@@ -28,34 +28,39 @@ 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 deleted.</p>
+Delete all data out of the cache folder.</p>
+</li>
+<li><p>verify:
+Verify the contents of the cache folder, garbage collecting any unneeded data,
+and verifying the integrity of the cache index and all cached data.</p>
</li>
</ul>
<h2 id="details">DETAILS</h2>
-<p>npm stores cache data in the directory specified in <code>npm config get cache</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/package.json:
-The package.json file, as npm sees it.</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. This is stored in <code>{cache}/{hostname}/{path}/.cache.json</code>.</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>
+<p>npm stores cache data in an opaque directory within the configured <code>cache</code>,
+named <code>_cacache</code>. This directory is a <code>cacache</code>-based content-addressable cache
+that stores all http request data as well as other package-related data. This
+directory is primarily accessed through <code>pacote</code>, the library responsible for
+all package fetching as of npm@5.</p>
+<p>All data that passes through the cache is fully verified for integrity on both
+insertion and extraction. Cache corruption will either trigger an error, or
+signal to <code>pacote</code> that the data must be refetched, which it will do
+automatically. For this reason, it should never be necessary to clear the cache
+for any reason other than reclaiming disk space, thus why <code>clean</code> now requires
+<code>--force</code> to run.</p>
+<p>There is currently no method exposed through npm to inspect or directly manage
+the contents of this cache. In order to access it, <code>cacache</code> must be used
+directly.</p>
+<p>npm will not remove data by itself: the cache will grow as new packages are
+installed.</p>
+<h2 id="a-note-about-the-cache-s-design">A NOTE ABOUT THE CACHE&#39;S DESIGN</h2>
+<p>The npm cache is strictly a cache: it should not be relied upon as a persistent
+and reliable data store for package data. npm makes no guarantee that a
+previously-cached piece of data will be available later, and will automatically
+delete corrupted contents. The primary guarantee that the cache makes is that,
+if it does return data, that data will be exactly the data that was inserted.</p>
+<p>To run an offline verification of existing cache contents, use <code>npm cache
+verify</code>.</p>
<h2 id="configuration">CONFIGURATION</h2>
<h3 id="cache">cache</h3>
<p>Default: <code>~/.npm</code> on Posix, or <code>%AppData%/npm-cache</code> on Windows.</p>
@@ -69,6 +74,8 @@ they do not make an HTTP request to the registry.</p>
<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>
+<li><a href="https://npm.im/cacache">https://npm.im/cacache</a></li>
+<li><a href="https://npm.im/pacote">https://npm.im/pacote</a></li>
</ul>
</div>
@@ -82,5 +89,5 @@ they do not make an HTTP request to the registry.</p>
<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>
<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>
</table>
-<p id="footer">npm-cache &mdash; npm@5.0.0-beta.56</p>
+<p id="footer">npm-cache &mdash; npm@5.0.0</p>