Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'man1/cache.1')
-rw-r--r--man1/cache.149
1 files changed, 25 insertions, 24 deletions
diff --git a/man1/cache.1 b/man1/cache.1
index 86f28627e..3f347c0a8 100644
--- a/man1/cache.1
+++ b/man1/cache.1
@@ -14,7 +14,7 @@ npm cache add <folder>
npm cache add <tarball url>
npm cache add <name>@<version>
npm cache ls [<path>]
-npm cache clean [<name>[@<version>]]
+npm cache clean [<path>]
.
.fi
.
@@ -22,54 +22,55 @@ npm cache clean [<name>[@<version>]]
.
.IP "\(bu" 4
add:
-Access the local cache of package data\. This command is primarily
+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\.
.
-.IP
-If two arguments are provided, then npm will fetch the data from the
-registry\. This allows npm to use the filesystem as a local proxy to
-the registry\.
-.
.IP "\(bu" 4
ls:
-Show the data in the cache\. Additional arguments are joined together
-in a path\-like fashion, but something like \fBnpm cache ls npm/0\.1\.5\fR is
-acceptable as well\.
+Show the data in the cache\. Argument is a path to show in the cache
+folder\. Works a bit like the \fBfind\fR program, but limited by the \fBdepth\fR config\.
.
.IP "\(bu" 4
clean:
-Delete data out of the cache for a specific package and version, all
-versions of a package, or all data for all packages, depending on the
-arguments supplied\.
-.
-.IP
-This can be used if invalid data gets into the cache\.
+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\.
.
.IP "" 0
.
.SH "DETAILS"
-npm stores data for a version of a package in \fB$ROOT/\.npm/\.cache/<name>/<version>\fR\|\. Three pieces of data are stored
-in this folder:
+npm stores cache data in \fB$HOME/\.npm\fR\|\. For each package that is added
+to the cache, three pieces of information are stored in \fB{cache}/{name}/{version}\fR:
.
.IP "\(bu" 4
-package/:
+\|\.\.\./package/:
A folder containing the package contents as they appear in the tarball\.
.
.IP "\(bu" 4
-package\.json:
+\|\.\.\./package\.json:
The package\.json file, as npm sees it, with overlays applied and a _id attribute\.
.
.IP "\(bu" 4
-package\.tgz:
+\|\.\.\./package\.tgz:
The tarball for that version\.
.
.IP "" 0
.
+.P
+Additionally, whenever a registry request is made, a \fB\|\.cache\.json\fR file
+is placed at the corresponding URI, to store the ETag and the requested
+data\.
+.
+.P
+Commands that make non\-essential registry requests (such as \fBsearch\fR and \fBview\fR, or the completion scripts) generally specify a minimum timeout\.
+If the \fB\|\.cache\.json\fR file is younger than the specified timeout, then
+they do not make an HTTP request to the registry\.
+.
.SH "CONFIGURATION"
.
-.SS "root"
-Default: \fB$INSTALL_PREFIX/lib/node\fR
+.SS "cache"
+Default: \fB$HOME/\.npm\fR on Posix, or \fB$HOME/npm\-cache\fR on Windows\.
.
.P
-The root folder where packages are installed and npm keeps its data\.
+The root cache folder\.