[NPM] Set default values for package.json using npm set

Npm by default uses global values when initializing a new package.json file. Learn how to set your own global default values by command line or editing the ~/.npmrc file.

 
npm set init.author.email "xxx@gmail.com"
npm set init.author.name "XXX"
npm set init.license "MIT"

Run:

npm init -y

Should bring all the init default value for you.

原文地址:https://www.cnblogs.com/Answer1215/p/9832277.html