node/deps/npm/man/man1/npm-cache.1

87 lines
2.1 KiB
Groff
Raw Normal View History

.TH "NPM\-CACHE" "1" "May 2015" "" ""
.SH "NAME"
2014-09-25 05:41:07 +08:00
\fBnpm-cache\fR \- Manipulates packages cache
.SH SYNOPSIS
.P
.RS 2
2014-11-05 07:08:12 +08:00
.nf
npm cache add <tarball file>
npm cache add <folder>
npm cache add <tarball url>
npm cache add <name>@<version>
2014-09-25 05:41:07 +08:00
npm cache ls [<path>]
2014-09-25 05:41:07 +08:00
npm cache clean [<path>]
2014-11-05 07:08:12 +08:00
.fi
2014-09-25 05:41:07 +08:00
.RE
.SH DESCRIPTION
.P
Used to add, list, or clear the npm cache folder\.
2014-09-25 05:41:07 +08:00
.RS 0
.IP \(bu 2
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\.
2014-09-25 05:41:07 +08:00
.IP \(bu 2
ls:
Show the data in the cache\. Argument is a path to show in the cache
2014-09-25 05:41:07 +08:00
folder\. Works a bit like the \fBfind\fR program, but limited by the
\fBdepth\fR config\.
.IP \(bu 2
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\.
2014-09-25 05:41:07 +08:00
.RE
.SH DETAILS
.P
2013-10-25 00:21:59 +08:00
npm stores cache data in the directory specified in \fBnpm config get cache\fR\|\.
For each package that is added to the cache, three pieces of information are
stored in \fB{cache}/{name}/{version}\fR:
2014-09-25 05:41:07 +08:00
.RS 0
.IP \(bu 2
2014-06-06 06:18:15 +08:00
\|\.\.\./package/package\.json:
The package\.json file, as npm sees it\.
2014-09-25 05:41:07 +08:00
.IP \(bu 2
\|\.\.\./package\.tgz:
The tarball for that version\.
2014-09-25 05:41:07 +08:00
.RE
.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
2014-06-06 06:18:15 +08:00
data\. This is stored in \fB{cache}/{hostname}/{path}/\.cache\.json\fR\|\.
.P
2014-09-25 05:41:07 +08:00
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\.
2014-09-25 05:41:07 +08:00
.SH CONFIGURATION
.SS cache
.P
2013-10-25 00:21:59 +08:00
Default: \fB~/\.npm\fR on Posix, or \fB%AppData%/npm\-cache\fR on Windows\.
.P
The root cache folder\.
2014-09-25 05:41:07 +08:00
.SH SEE ALSO
.RS 0
.IP \(bu 2
2014-09-17 06:38:50 +08:00
npm help 5 folders
2014-09-25 05:41:07 +08:00
.IP \(bu 2
npm help config
2014-09-25 05:41:07 +08:00
.IP \(bu 2
2014-09-17 06:38:50 +08:00
npm help 7 config
2014-09-25 05:41:07 +08:00
.IP \(bu 2
2014-09-17 06:38:50 +08:00
npm help 5 npmrc
2014-09-25 05:41:07 +08:00
.IP \(bu 2
npm help install
2014-09-25 05:41:07 +08:00
.IP \(bu 2
npm help publish
2014-09-25 05:41:07 +08:00
.IP \(bu 2
npm help pack
2014-09-25 05:41:07 +08:00
.RE