Skip to content

Commit 860eeb3

Browse files
committed
fix(docs): add caching docs to exec, init
fix grammar on caching docs for search
1 parent eb4f069 commit 860eeb3

File tree

3 files changed

+47
-2
lines changed

3 files changed

+47
-2
lines changed

docs/content/commands/npm-exec.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,28 @@ This resulted in some shifts in its functionality:
173173
- The `--shell` option is replaced with `--script-shell`, but maintained
174174
in the `npx` executable for backwards compatibility.
175175

176+
### A note on caching
177+
178+
The npm cli utilizes its internal package cache when using the package
179+
name specified. You can use the following to change how and when the
180+
cli uses this cache. See [`npm cache`](/commands/npm-cache) for more on
181+
how the cache works.
182+
183+
#### prefer-online
184+
185+
Forced staleness checks for packages, making the cli look for updates
186+
immediately even if the package is already in the cache.
187+
188+
#### prefer-offline
189+
190+
Bypasses staleness checks for packages. Missing data will still be
191+
requested from the server. To force full offline mode, use `offline`.
192+
193+
#### offline
194+
195+
Forces full offline mode. Any packages not locally cached will result in
196+
an error.
197+
176198
### See Also
177199

178200
* [npm run-script](/commands/npm-run-script)

docs/content/commands/npm-init.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,32 @@ Generate it without having it ask any questions:
7171
$ npm init -y
7272
```
7373

74+
### A note on caching
75+
76+
The npm cli utilizes its internal package cache when using the package
77+
name specified. You can use the following to change how and when the
78+
cli uses this cache. See [`npm cache`](/commands/npm-cache) for more on
79+
how the cache works.
80+
81+
#### prefer-online
82+
83+
Forced staleness checks for packages, making the cli look for updates
84+
immediately even if the package is already in the cache.
85+
86+
#### prefer-offline
87+
88+
Bypasses staleness checks for packages. Missing data will still be
89+
requested from the server. To force full offline mode, use `offline`.
90+
91+
#### offline
92+
93+
Forces full offline mode. Any packages not locally cached will result in
94+
an error.
95+
7496
### See Also
7597

7698
* [init-package-json module](http://npm.im/init-package-json)
7799
* [package.json](/configuring-npm/package-json)
78100
* [npm version](/commands/npm-version)
79101
* [npm scope](/using-npm/scope)
102+
* [npm exec](/commands/npm-exec)

docs/content/commands/npm-search.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ updates immediately even for fresh search results.
115115

116116
#### prefer-offline
117117

118-
Bypasses staleness checks for cached. Missing data will still be
119-
requested from the server. To force full offline mode, use `offline`.
118+
Bypasses staleness checks for cached searches. Missing data will still
119+
be requested from the server. To force full offline mode, use `offline`.
120120

121121
#### offline
122122

0 commit comments

Comments
 (0)