Skip to content

Commit 1e4e6e9

Browse files
ruyadornodarcyclarke
authored andcommitted
docs: v7 using npm config refresh
Credit: @ruyadorno Close: #1938 Reviewed-by: @darcyclarke
1 parent 5c1c2da commit 1e4e6e9

File tree

2 files changed

+48
-72
lines changed

2 files changed

+48
-72
lines changed

docs/content/using-npm/config.md

Lines changed: 46 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -109,33 +109,6 @@ npm ls -gpld
109109
npm ls --global --parseable --long --loglevel info
110110
```
111111

112-
### Per-Package Config Settings
113-
114-
When running scripts (see [`scripts`](/using-npm/scripts)) the package.json "config"
115-
keys are overwritten in the environment if there is a config param of
116-
`<name>[@<version>]:<key>`. For example, if the package.json has
117-
this:
118-
119-
```json
120-
{ "name" : "foo"
121-
, "config" : { "port" : "8080" }
122-
, "scripts" : { "start" : "node server.js" } }
123-
```
124-
125-
and the server.js is this:
126-
127-
```javascript
128-
http.createServer(...).listen(process.env.npm_package_config_port)
129-
```
130-
131-
then the user could change the behavior by doing:
132-
133-
```bash
134-
npm config set foo:port 80
135-
```
136-
137-
See [package.json](/configuring-npm/package-json) for more information.
138-
139112
### Config Settings
140113

141114
#### access
@@ -325,6 +298,18 @@ Number of ms to wait for cache lock files to expire.
325298

326299
`--cache-min=9999 (or bigger)` is an alias for `--prefer-offline`.
327300

301+
#### call
302+
303+
* Default: ""
304+
* Type: String
305+
306+
Optional companion option for `npm exec`, `npx` that allows for specifying a
307+
custom command to be run along with the installed packages.
308+
309+
```bash
310+
npm exec --package yo --package generator-node --call "yo node"
311+
```
312+
328313
#### cert
329314

330315
* Default: `null`
@@ -346,6 +331,13 @@ It is _not_ the path to a certificate file (and there is no "certfile" option).
346331

347332
This is a list of CIDR address to be used when configuring limited access tokens with the `npm token create` command.
348333

334+
#### commit-hooks
335+
336+
* Default: `true`
337+
* Type: Boolean
338+
339+
Run git commit hooks when using the `npm version` command.
340+
349341
#### color
350342

351343
* Default: true
@@ -359,12 +351,12 @@ disabled when the environment variable `NO_COLOR` is set to any value.
359351

360352
#### depth
361353

362-
* Default: 0
363-
* Type: Number
354+
* Default: null
355+
* Type: null or Number
364356

365357
The depth to go when recursing packages for `npm ls`.
366358

367-
To make this default to `Infinity` instead of `0`, set `--all`.
359+
To make this default to `Infinity` instead of `null`, set `--all`.
368360

369361
#### description
370362

@@ -378,7 +370,7 @@ Show the description in `npm search`
378370
* Default: false
379371
* Type: Boolean
380372

381-
Install `dev-dependencies` along with packages.
373+
\[Deprecated\] Install `dev-dependencies` along with packages.
382374

383375
#### dry-run
384376

@@ -438,6 +430,15 @@ recommended that you do not use this option!
438430

439431
Format `package-lock.json` or `npm-shrinkwrap.json` as a human readable file.
440432

433+
#### fund
434+
435+
* Default: true
436+
* Type: Boolean
437+
438+
When "true" displays the message at the end of each `npm install`
439+
aknowledging the number of dependencies looking for funding.
440+
See [`npm fund`](/cli-commands/fund) for details.
441+
441442
#### fetch-retries
442443

443444
* Default: 2
@@ -477,15 +478,6 @@ packages.
477478

478479
The maximum amount of time to wait for HTTP requests to complete.
479480

480-
#### fund
481-
482-
* Default: true
483-
* Type: Boolean
484-
485-
When "true" displays the message at the end of each `npm install`
486-
aknowledging the number of dependencies looking for funding.
487-
See [`npm fund`](/cli-commands/fund) for details.
488-
489481
#### git
490482

491483
* Default: `"git"`
@@ -502,13 +494,6 @@ the git binary.
502494

503495
Tag the commit when using the `npm version` command.
504496

505-
#### commit-hooks
506-
507-
* Default: `true`
508-
* Type: Boolean
509-
510-
Run git commit hooks when using the `npm version` command.
511-
512497
#### global
513498

514499
* Default: false
@@ -542,14 +527,6 @@ on will be flattened in their `node_modules` folders. This obviously will
542527
eliminate some deduping. If used with `legacy-bundling`, `legacy-bundling` will be
543528
preferred.
544529

545-
#### group
546-
547-
* Default: GID of the current process
548-
* Type: String or Number
549-
550-
The group to use when running package scripts in global mode as the root
551-
user.
552-
553530
#### heading
554531

555532
* Default: `"npm"`
@@ -591,46 +568,59 @@ If true, npm will not run `prepublish` scripts.
591568

592569
If true, npm does not run scripts specified in package.json files.
593570

571+
#### include
572+
573+
* Default: `[prod|dev|optional|peer]`
574+
* Type: Array
575+
576+
Option that allows for defining which types of dependencies to install.
577+
594578
#### init-module
595579

580+
* Alias: `init.module`
596581
* Default: ~/.npm-init.js
597582
* Type: path
598583

599584
A module that will be loaded by the `npm init` command. See the
600585
documentation for the
601-
[init-package-json](https://github.com/isaacs/init-package-json) module
586+
[init-package-json](https://github.com/npm/init-package-json) module
602587
for more information, or [npm init](/cli-commands/init).
603588

604589
#### init-author-name
605590

591+
* Alias: `init.author.name`
606592
* Default: ""
607593
* Type: String
608594

609595
The value `npm init` should use by default for the package author's name.
610596

611597
#### init-author-email
612598

599+
* Alias: `init.author.email`
613600
* Default: ""
614601
* Type: String
615602

616603
The value `npm init` should use by default for the package author's email.
617604

618605
#### init-author-url
619606

607+
* Alias: `init.author.url`
620608
* Default: ""
621609
* Type: String
622610

623611
The value `npm init` should use by default for the package author's homepage.
624612

625613
#### init-license
626614

615+
* Alias: `init.license`
627616
* Default: "ISC"
628617
* Type: String
629618

630619
The value `npm init` should use by default for the package license.
631620

632621
#### init-version
633622

623+
* Alias: `init.version`
634624
* Default: "1.0.0"
635625
* Type: semver
636626

@@ -1247,15 +1237,6 @@ on success, but left behind on failure for forensic purposes.
12471237
When set to true, npm uses unicode characters in the tree output. When
12481238
false, it uses ascii characters to draw trees.
12491239

1250-
#### unsafe-perm
1251-
1252-
* Default: false if running as root, true otherwise
1253-
* Type: Boolean
1254-
1255-
Set to true to suppress the UID/GID switching when running package
1256-
scripts. If set explicitly to false, then installing as a non-root user
1257-
will fail.
1258-
12591240
#### update-notifier
12601241

12611242
* Default: true
@@ -1272,13 +1253,6 @@ version of npm than the latest.
12721253
Set to show short usage output (like the -H output)
12731254
instead of complete help when doing [`npm help`](/cli-commands/help).
12741255

1275-
#### user
1276-
1277-
* Default: "nobody"
1278-
* Type: String or Number
1279-
1280-
The UID to set to when running package scripts as root.
1281-
12821256
#### userconfig
12831257

12841258
* Default: ~/.npmrc

lib/utils/config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,8 @@ const types = {
231231
global: Boolean,
232232
'global-style': Boolean,
233233
globalconfig: path,
234+
'https-proxy': [null, url],
235+
'user-agent': String,
234236
heading: String,
235237
'https-proxy': [null, url],
236238
'if-present': Boolean,

0 commit comments

Comments
 (0)