2012-08-07 04:07:31 +08:00
. \" Generated with Ronnjs 0.3.8
2011-11-27 01:21:03 +08:00
. \" http://github.com/kapouer/ronnjs/
.
2014-08-01 00:05:30 +08:00
.TH "NPM\-CACHE" "1" "July 2014" "" ""
2011-11-27 01:21:03 +08:00
.
.SH "NAME"
\fB npm-cache\fR \- \- Manipulates packages cache
.
.SH "SYNOPSIS"
.
.nf
npm cache add <tarball file>
npm cache add <folder>
npm cache add <tarball url>
npm cache add <name>@<version>
npm cache ls [<path>]
npm cache clean [<path>]
.
.fi
.
.SH "DESCRIPTION"
Used to add, list, or clear the npm cache folder\.
.
.IP "\(bu" 4
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\.
.
.IP "\(bu" 4
ls:
Show the data in the cache\. Argument is a path to show in the cache
folder\. Works a bit like the \fB find\fR program, but limited by the \fB depth\fR config\.
.
.IP "\(bu" 4
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\.
.
.IP "" 0
.
.SH "DETAILS"
2013-10-25 00:21:59 +08:00
npm stores cache data in the directory specified in \fB npm 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 :
2011-11-27 01:21:03 +08:00
.
.IP "\(bu" 4
2014-06-06 06:18:15 +08:00
\| \. \. \. /package/package\. json:
The package\. json file, as npm sees it\.
2011-11-27 01:21:03 +08:00
.
.IP "\(bu" 4
\| \. \. \. /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
2014-06-06 06:18:15 +08:00
data\. This is stored in \fB {cache}/{hostname}/{path}/\. cache\. json\fR \| \.
2011-11-27 01:21:03 +08:00
.
.P
Commands that make non\- essential registry requests (such as \fB search\fR and \fB view\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 "cache"
2013-10-25 00:21:59 +08:00
Default: \fB ~/\. npm\fR on Posix, or \fB %AppData%/npm\- cache\fR on Windows\.
2011-11-27 01:21:03 +08:00
.
.P
The root cache folder\.
.
.SH "SEE ALSO"
.
.IP "\(bu" 4
2013-07-12 23:55:57 +08:00
npm help folders
2011-11-27 01:21:03 +08:00
.
.IP "\(bu" 4
npm help config
.
.IP "\(bu" 4
2013-07-12 23:55:57 +08:00
npm help config
.
.IP "\(bu" 4
npm help npmrc
.
.IP "\(bu" 4
2011-11-27 01:21:03 +08:00
npm help install
.
.IP "\(bu" 4
npm help publish
.
.IP "\(bu" 4
npm help pack
.
.IP "" 0