Set `npm init` defaults globally

You can either edit the global configuration file for npm:

npm config edit --global

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

Or, you can set the defaults one by one:

# npm config set <key> <value> [-g|--global]
npm config set -g init-author-name 'Aamnah'
npm config set -g init-author-email 'hello@aamnah.com'
npm config set -g init-author-url 'http://aamnah.com'
npm config set -g init-license 'CC-BY-SA-4.0'
npm 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.

npm init -y

To list all config values

npm config list