Skip to content

Commit 9e13d06

Browse files
author
CI User
committed
CLI documentation update from CI
1 parent 62e9681 commit 9e13d06

File tree

4 files changed

+69
-7
lines changed

4 files changed

+69
-7
lines changed

cli/v8

Submodule v8 updated 80 files

content/cli/v8/commands/npm-version.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,17 @@ This value is not exported to the environment for child processes.
154154
<!-- automatically generated, do not edit manually -->
155155
<!-- see lib/utils/config/definitions.js -->
156156

157+
#### `workspaces-update`
158+
159+
* Default: true
160+
* Type: Boolean
161+
162+
If set to true, the npm cli will run an update after operations that may
163+
possibly change the workspaces installed to the `node_modules` folder.
164+
165+
<!-- automatically generated, do not edit manually -->
166+
<!-- see lib/utils/config/definitions.js -->
167+
157168
#### `include-workspace-root`
158169

159170
* Default: false

content/cli/v8/using-npm/config.md

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,13 +1035,26 @@ See also the `foreground-scripts` config.
10351035
<!-- automatically generated, do not edit manually -->
10361036
<!-- see lib/utils/config/definitions.js -->
10371037

1038+
#### `logs-dir`
1039+
1040+
* Default: A directory named `_logs` inside the cache
1041+
* Type: null or Path
1042+
1043+
The location of npm's log directory. See [`npm logging`](/cli/v8/using-npm/logging)
1044+
for more information.
1045+
1046+
<!-- automatically generated, do not edit manually -->
1047+
<!-- see lib/utils/config/definitions.js -->
1048+
10381049
#### `logs-max`
10391050

10401051
* Default: 10
10411052
* Type: Number
10421053

10431054
The maximum number of log files to store.
10441055

1056+
If set to 0, no log files will be written for the current run.
1057+
10451058
<!-- automatically generated, do not edit manually -->
10461059
<!-- see lib/utils/config/definitions.js -->
10471060

@@ -1636,9 +1649,9 @@ particular, use care when overriding this setting for public packages.
16361649
* Default: false
16371650
* Type: Boolean
16381651

1639-
If true, writes an `npm-debug` log to `_logs` and timing information to
1640-
`_timing.json`, both in your cache, even if the command completes
1641-
successfully. `_timing.json` is a newline delimited list of JSON objects.
1652+
If true, writes a debug log to `logs-dir` and timing information to
1653+
`_timing.json` in the cache, even if the command completes successfully.
1654+
`_timing.json` is a newline delimited list of JSON objects.
16421655

16431656
You can quickly view it with this [json](https://npm.im/json) command line:
16441657
`npm exec -- json -g < ~/.npm/_timing.json`.
@@ -1831,6 +1844,17 @@ This value is not exported to the environment for child processes.
18311844
<!-- automatically generated, do not edit manually -->
18321845
<!-- see lib/utils/config/definitions.js -->
18331846

1847+
#### `workspaces-update`
1848+
1849+
* Default: true
1850+
* Type: Boolean
1851+
1852+
If set to true, the npm cli will run an update after operations that may
1853+
possibly change the workspaces installed to the `node_modules` folder.
1854+
1855+
<!-- automatically generated, do not edit manually -->
1856+
<!-- see lib/utils/config/definitions.js -->
1857+
18341858
#### `yes`
18351859

18361860
* Default: null

content/cli/v8/using-npm/logging.md

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Logging
33
section: 7
4-
description: Why, What & How we Log
4+
description: Why, What & How We Log
55
redirect_from:
66
- /using-npm/logging
77
- /using-npm/logging.html
@@ -16,6 +16,17 @@ github_path: docs/content/using-npm/logging.md
1616

1717
The `npm` CLI has various mechanisms for showing different levels of information back to end-users for certain commands, configurations & environments.
1818

19+
### Setting Log File Location
20+
21+
All logs are written to a debug log, with the path to that file printed if the execution of a command fails.
22+
23+
The default location of the logs directory is a directory named `_logs` inside the npm cache. This can be changed
24+
with the `logs-dir` config option.
25+
26+
Log files will be removed from the `logs-dir` when the number of log files exceeds `logs-max`, with the oldest logs being deleted first.
27+
28+
To turn off logs completely set `--logs-max=0`.
29+
1930
### Setting Log Levels
2031

2132
#### `loglevel`
@@ -36,8 +47,6 @@ The default value of `loglevel` is `"notice"` but there are several levels/types
3647

3748
All logs pertaining to a level proceeding the current setting will be shown.
3849

39-
All logs are written to a debug log, with the path to that file printed if the execution of a command fails.
40-
4150
##### Aliases
4251

4352
The log levels listed above have various corresponding aliases, including:
@@ -55,6 +64,15 @@ The log levels listed above have various corresponding aliases, including:
5564

5665
The `npm` CLI began hiding the output of lifecycle scripts for `npm install` as of `v7`. Notably, this means you will not see logs/output from packages that may be using "install scripts" to display information back to you or from your own project's scripts defined in `package.json`. If you'd like to change this behavior & log this output you can set `foreground-scripts` to `true`.
5766

67+
### Timing Information
68+
69+
The `--timing` config can be set which does two things:
70+
71+
1. Always shows the full path to the debug log regardless of command exit status
72+
1. Write timing information to a timing file in the cache or `logs-dir`
73+
74+
This file is a newline delimited list of JSON objects that can be inspected to see timing data for each task in a `npm` CLI run.
75+
5876
### Registry Response Headers
5977

6078
#### `npm-notice`
@@ -63,6 +81,15 @@ The `npm` CLI reads from & logs any `npm-notice` headers that are returned from
6381

6482
This header is not cached, and will not be logged if the request is served from the cache.
6583

84+
### Logs and Sensitive Information
85+
86+
The `npm` CLI makes a best effort to redact the following from terminal output and log files:
87+
88+
- Passwords inside basic auth URLs
89+
- npm tokens
90+
91+
However, this behavior should not be relied on to keep all possible sensitive information redacted. If you are concerned about secrets in your log file or terminal output, you can use `--loglevel=silent` and `--logs-max=0` to ensure no logs are written to your terminal or filesystem.
92+
6693
### See also
6794

6895
* [config](/cli/v8/using-npm/config)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy