1. Set the default NPM init property
npm config set init-author-name yanggc
npm config set init-author-email [email protected]
npm config set init-author-url yanggc.com
npm config set init-version=1.0. 0
npm config set init-license=ISC
Copy the code
After setting the default values, check whether the Settings take effect by using NPM config Edit or NPM init -y
2. Quickly generate package.json
Normally we initialize the project with the NPM init command. If we use the default information to generate package.json, we need to repeatedly enter to complete the initialization process. Using the following command, you can generate package.json with one click
npm init -y // NPM init --yes
Copy the code
3. Install multiple modules at a time
npm install lodash axios url-loader
Copy the code
4. Abbreviations of installation commands
npm i lodash // NPM install lodash
npm i -g lodash NPM install -- short for global lodash
npm install -D lodash // NPM install --save-dev lodash
npm install -S lodash // NPM install --save lodash
npm t //npm test
Copy the code
5. Open the Github address of the dependency package
npm repo lodash // Open the Github address of the Lodash toolkit
Copy the code
6. Open the dependency package’s Homepage or official website
npm home lodash
Copy the code
7. Execute the scripts in sequence
npm run serve & npm run dev // Execute the serve and dev scripts in parallel
npm run serve && npm run build // The build script is executed only after the serve script is successfully executed
Copy the code