How to create a project to automatically configure the default npm

background knowledge

  • NodeJs
  • NPM

Creating NodeJs project

mkdir my-pro && cd my-pro
npm init -y

The default configuration file is automatically generated package.json,
how to automatically configure content really want to automatically fill it?

Configuration

npm config set init.author.name = xxx // 配置名称
npm config set init.author.eamil = xxx //配置邮箱
npm config set init.author.url = xxx // 配置个人网址
npm config set init.license = xxx // 配置协议

View Configuration

npm config list //查看基本配置
npm config list -l //查看所有配置

reference

  1. npm-config
  2. Creating a package.json file

Guess you like

Origin www.cnblogs.com/zhourongcode/p/12466795.html