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
path: root/docs
diff options
context:
space:
mode:
authorGar <gar+gh@danger.computer>2021-01-26 01:07:02 +0300
committernlf <quitlahok@gmail.com>2021-01-28 23:37:38 +0300
commit7772d9f9f9f853573a7ff8e7fb60c5e46566f596 (patch)
tree55007d8d8e24f321ac988f0f2a488f80ff9d2897 /docs
parentba3aa4ca9d226133dbcc36cbaba0464c88e7838c (diff)
fix(docs): add caching docs to exec, init
fix grammar on caching docs for search PR-URL: https://github.com/npm/cli/pull/2542 Credit: @wraithgar Close: #2542 Reviewed-by: @ruyadorno
Diffstat (limited to 'docs')
-rw-r--r--docs/content/commands/npm-exec.md22
-rw-r--r--docs/content/commands/npm-init.md23
-rw-r--r--docs/content/commands/npm-search.md6
3 files changed, 48 insertions, 3 deletions
diff --git a/docs/content/commands/npm-exec.md b/docs/content/commands/npm-exec.md
index 3ae30fa0c..cb3e51c82 100644
--- a/docs/content/commands/npm-exec.md
+++ b/docs/content/commands/npm-exec.md
@@ -173,6 +173,28 @@ This resulted in some shifts in its functionality:
- The `--shell` option is replaced with `--script-shell`, but maintained
in the `npx` executable for backwards compatibility.
+### A note on caching
+
+The npm cli utilizes its internal package cache when using the package
+name specified. You can use the following to change how and when the
+cli uses this cache. See [`npm cache`](/commands/npm-cache) for more on
+how the cache works.
+
+#### prefer-online
+
+Forces staleness checks for packages, making the cli look for updates
+immediately even if the package is already in the cache.
+
+#### prefer-offline
+
+Bypasses staleness checks for packages. Missing data will still be
+requested from the server. To force full offline mode, use `offline`.
+
+#### offline
+
+Forces full offline mode. Any packages not locally cached will result in
+an error.
+
### See Also
* [npm run-script](/commands/npm-run-script)
diff --git a/docs/content/commands/npm-init.md b/docs/content/commands/npm-init.md
index 3eac92317..8a40d90e8 100644
--- a/docs/content/commands/npm-init.md
+++ b/docs/content/commands/npm-init.md
@@ -71,9 +71,32 @@ Generate it without having it ask any questions:
$ npm init -y
```
+### A note on caching
+
+The npm cli utilizes its internal package cache when using the package
+name specified. You can use the following to change how and when the
+cli uses this cache. See [`npm cache`](/commands/npm-cache) for more on
+how the cache works.
+
+#### prefer-online
+
+Forces staleness checks for packages, making the cli look for updates
+immediately even if the package is already in the cache.
+
+#### prefer-offline
+
+Bypasses staleness checks for packages. Missing data will still be
+requested from the server. To force full offline mode, use `offline`.
+
+#### offline
+
+Forces full offline mode. Any packages not locally cached will result in
+an error.
+
### See Also
* [init-package-json module](http://npm.im/init-package-json)
* [package.json](/configuring-npm/package-json)
* [npm version](/commands/npm-version)
* [npm scope](/using-npm/scope)
+* [npm exec](/commands/npm-exec)
diff --git a/docs/content/commands/npm-search.md b/docs/content/commands/npm-search.md
index 33864d472..35178bcb0 100644
--- a/docs/content/commands/npm-search.md
+++ b/docs/content/commands/npm-search.md
@@ -110,13 +110,13 @@ on how the cache works.
#### prefer-online
-Forced staleness checks for cached searches, making the cli look for
+Forces staleness checks for cached searches, making the cli look for
updates immediately even for fresh search results.
#### prefer-offline
-Bypasses staleness checks for cached. Missing data will still be
-requested from the server. To force full offline mode, use `offline`.
+Bypasses staleness checks for cached searches. Missing data will still
+be requested from the server. To force full offline mode, use `offline`.
#### offline