Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix(docs): add caching docs to exec, init
fix grammar on caching docs for search

PR-URL: #2542
Credit: @wraithgar
Close: #2542
Reviewed-by: @ruyadorno
  • Loading branch information
wraithgar authored and nlf committed Jan 28, 2021
1 parent ba3aa4c commit 7772d9f
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 3 deletions.
22 changes: 22 additions & 0 deletions docs/content/commands/npm-exec.md
Expand Up @@ -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)
Expand Down
23 changes: 23 additions & 0 deletions docs/content/commands/npm-init.md
Expand Up @@ -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)
6 changes: 3 additions & 3 deletions docs/content/commands/npm-search.md
Expand Up @@ -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

Expand Down

0 comments on commit 7772d9f

Please sign in to comment.