CLI documentation update from CI

CI User committed Jul 2, 2021 at 02:25 UTC 1f4958f9699b18041b637d2b42080bc77bd7290d
3 files changed +4 -55
cli/v7
+1 -1
@@ -1 +1 @@
1 -Subproject commit cf55fe0f06a1e50454b5c2bcf40652cb6fb68e53
1 +Subproject commit 665a7bde900d7fbf46aca609b0b9c92b5508a3ea
content/cli/v7/configuring-npm/package-json.md
+2 -6
@@ -559,12 +559,8 @@ had the following:
559 }
560 ```
561
562 -and then had a "start" command that then referenced the
563 -`npm_package_config_port` environment variable, then the user could
564 -override that by doing `npm config set foo:port 8001`.
565 -
566 -See [`config`](/cli/v7/using-npm/config) and [`scripts`](/cli/v7/using-npm/scripts) for
567 -more on package configs.
562 +It could also have a "start" command that referenced the
563 +`npm_package_config_port` environment variable.
564
565 ### dependencies
566
content/cli/v7/using-npm/scripts.md
+1 -48
@@ -253,41 +253,7 @@ package.json file, then your package scripts would have the
253 in your code with `process.env.npm_package_name` and
254 `process.env.npm_package_version`, and so on for other fields.
255
256 -#### configuration
257 -
258 -Configuration parameters are put in the environment with the
259 -`npm_config_` prefix. For instance, you can view the effective `root`
260 -config by checking the `npm_config_root` environment variable.
261 -
262 -#### Special: package.json "config" object
263 -
264 -The package.json "config" keys are overwritten in the environment if
265 -there is a config param of `<name>[@<version>]:<key>`. For example,
266 -if the package.json has this:
267 -
268 -```json
269 -{
270 - "name" : "foo",
271 - "config" : {
272 - "port" : "8080"
273 - },
274 - "scripts" : {
275 - "start" : "node server.js"
276 - }
277 -}
278 -```
279 -
280 -and the server.js is this:
281 -
282 -```javascript
283 -http.createServer(...).listen(process.env.npm_package_config_port)
284 -```
285 -
286 -then the user could change the behavior by doing:
287 -
288 -```bash
289 - npm config set foo:port 80
290 - ```
256 +See [`package-json.md`](/cli/v7/using-npm/package-json) for more on package configs.
257
258 #### current lifecycle event
259
@@ -349,19 +315,6 @@ Note that these script files don't have to be nodejs or even
315 javascript programs. They just have to be some kind of executable
316 file.
317
352 -### Hook Scripts
353 -
354 -If you want to run a specific script at a specific lifecycle event for
355 -ALL packages, then you can use a hook script.
356 -
357 -Place an executable file at `node_modules/.hooks/{eventname}`, and
358 -it'll get run for all packages when they are going through that point
359 -in the package lifecycle for any packages installed in that root.
360 -
361 -Hook scripts are run exactly the same way as package.json scripts.
362 -That is, they are in a separate child process, with the env described
363 -above.
364 -
318 ### Best Practices
319
320 * Don't exit with a non-zero error code unless you *really* mean it.