Notes

Set `npm init` defaults globally

Edit on GitHub


JavaScript

You can either edit the global configuration file for npm:

1npm config edit --global

(it’ll open the file in your default editor, usually Vim)

Or, you can set the defaults one by one:

1# npm config set <key> <value> [-g|--global]
2npm config set -g init-author-name 'Aamnah'
3npm config set -g init-author-email 'hello@aamnah.com'
4npm config set -g init-author-url 'http://aamnah.com'
5npm config set -g init-license 'CC-BY-SA-4.0'
6npm config set -g init-version '0.0.1'

You can also use the npm init command with the y flag to initiate a project with the default values without prompting you for details.

1npm init -y

To list all config values

1npm config list

Related