Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(docs): add caching docs to exec, init #2542

Merged
merged 1 commit into from Jan 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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