Yarn and NPM's command line summary _node.js

Source: Internet
Author: User
Tags json

First, need to understand the command

npm install= = = yarn --install installation is the default behavior.

npm install taco --save= = = yarn add taco --taco package is immediately saved to Package.json.

npm uninstall taco --save ===yarn remove taco

In NPM, you can use npm config set save true settings- -save The default behavior, but this is not obvious to most developers. In yarn, the behavior of adding (add) and removing (remove) in Package.json is the default.

npm install taco --save-dev ===yarn add taco --dev

npm update --save ===yarn upgrade

Update (UPDATE) vs Upgrade (upgrade), Praise! Upgrade is the actual thing to do! When the version number is promoted, it happens to be upgrade!.

Note: npm update--save seems to have a problem with version 3.11.

npm install taco@latest --save ===yarn add taco

npm install taco --global = = =- yarn global add taco Use the global tag carefully, as always.

Ii. Known Orders

The package is the same as the NPM registry. In general, Yarn is just a new installation tool, and the NPM structure is the same as registry.

npm init ===yarn init

npm link ===yarn link

npm outdated ===yarn outdated

npm publish ===yarn publish

npm run ===yarn run

npm cache clean ===yarn cache clean

npm login === yarn login (Logout empathy)

npm test ===yarn test

Iii. Yarn's unique order

I skipped over some of the things that reminded us not to use, such as yarn clean .

yarn licenses ls -Allows you to check dependent license information.

yarn licenses generate --Create dependent disclaimer license automatically.

yarn why taco--Check why the taco is installed, detailing other packages that depend on it (acknowledgements Olivier Combe).

Emojis

Speed

Shrinkwrap function automatically implemented by yarn Lockfile

Security-centric design

Four, NPM's unique command

npm xmas = = NO equivalent

npm visnup= = NO equivalent

Summarize

When I wrote this article, I found that yarn's Run command seemed to be a bit of a problem and should be repaired in 0.15.2. At this point, NPM is much better. The above is the entire content of this article, I hope the content of this article for everyone's study or work can bring certain help, if you have questions you can message exchange.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.