Setting package.json defaults

I want to set few package.json property defaults.

For example, most of my libraries published on NPM, have the MIT license. Also, I am the author of most of them (sometimes the author is the company I work for).

How can I set such defaults?

I expect the following behavior:

$ npm init
...
author: (Ionică Bizău)
license: (MIT)
...

So, just pressing enter will set the default values.

To see npm configuration, run:

npm config list

which typically will contain such

userconfig /home/scott/.npmrc

cat above file to see all your overrides

npm config ls -l #  to show all defaults

you can manually define defaults

npm config edit  # view then change all settings

alternatively you can interactively set defaults :

npm set init.author.name "<Your Name>"
npm set init.author.email "you@example.com"
npm set init.author.url "example.com"
npm set init.license = "MIT"

each set has a corresponding get

Use npmrc to set your defaults.