CLI documentation update from CI
CI User committed
Mar 25, 2022 at 02:38 UTC
9e13d063da19057258c1da75d7429d67af6e811d
4 files changed
+69
-7
cli/v8
+1
-1
@@ -1 +1 @@
1
-Subproject commit 362831c4eba2554b44feec60fdff197d92eac0c1
1
+Subproject commit 716a07fde7905bb69e4c6f1991bb7289589a6669
content/cli/v8/commands/npm-version.md
+11
@@ -154,6 +154,17 @@ This value is not exported to the environment for child processes.
154
<!-- automatically generated, do not edit manually -->
155
<!-- see lib/utils/config/definitions.js -->
156
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
+
168
#### `include-workspace-root`
169
170
* Default: false
content/cli/v8/using-npm/config.md
+27
-3
@@ -1035,6 +1035,17 @@ See also the `foreground-scripts` config.
1035
<!-- automatically generated, do not edit manually -->
1036
<!-- see lib/utils/config/definitions.js -->
1037
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
+
1049
#### `logs-max`
1050
1051
* Default: 10
@@ -1042,6 +1053,8 @@ See also the `foreground-scripts` config.
1053
1054
The maximum number of log files to store.
1055
1056
+If set to 0, no log files will be written for the current run.
1057
+
1058
<!-- automatically generated, do not edit manually -->
1059
<!-- see lib/utils/config/definitions.js -->
1060
@@ -1636,9 +1649,9 @@ particular, use care when overriding this setting for public packages.
1649
* Default: false
1650
* Type: Boolean
1651
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.
1655
1656
You can quickly view it with this [json](https://npm.im/json) command line:
1657
`npm exec -- json -g < ~/.npm/_timing.json`.
@@ -1831,6 +1844,17 @@ This value is not exported to the environment for child processes.
1844
<!-- automatically generated, do not edit manually -->
1845
<!-- see lib/utils/config/definitions.js -->
1846
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
+
1858
#### `yes`
1859
1860
* Default: null
content/cli/v8/using-npm/logging.md
+30
-3
@@ -1,7 +1,7 @@
1
---
2
title: Logging
3
section: 7
4
-description: Why, What & How we Log
4
+description: Why, What & How We Log
5
redirect_from:
6
- /using-npm/logging
7
- /using-npm/logging.html
@@ -16,6 +16,17 @@ github_path: docs/content/using-npm/logging.md
16
17
The `npm` CLI has various mechanisms for showing different levels of information back to end-users for certain commands, configurations & environments.
18
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
+
30
### Setting Log Levels
31
32
#### `loglevel`
@@ -36,8 +47,6 @@ The default value of `loglevel` is `"notice"` but there are several levels/types
47
48
All logs pertaining to a level proceeding the current setting will be shown.
49
39
-All logs are written to a debug log, with the path to that file printed if the execution of a command fails.
40
-
50
##### Aliases
51
52
The log levels listed above have various corresponding aliases, including:
@@ -55,6 +64,15 @@ The log levels listed above have various corresponding aliases, including:
64
65
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`.
66
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
+
76
### Registry Response Headers
77
78
#### `npm-notice`
@@ -63,6 +81,15 @@ The `npm` CLI reads from & logs any `npm-notice` headers that are returned from
81
82
This header is not cached, and will not be logged if the request is served from the cache.
83
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
+
93
### See also
94
95
* [config](/cli/v8/using-npm/config)