Skip to content

Commit

Permalink
fix(docs): add caching docs to exec, init
Browse files Browse the repository at this point in the history
fix grammar on caching docs for search
  • Loading branch information
wraithgar committed Jan 25, 2021
1 parent eb4f069 commit 860eeb3
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 2 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

Forced 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

Forced 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)
4 changes: 2 additions & 2 deletions docs/content/commands/npm-search.md
Expand Up @@ -115,8 +115,8 @@ 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 860eeb3

Please sign in to comment.