yarn vs npm

yarn is similar to npm.

how to install yarn:

npm install yarn -g or choco install yarn

npm vs yarn:

yarnnpm说明
yarn initnpm init初始化项目,生成package.json文件
yarn add 模块名npm install 模块名 --save在本目录下添加项目的依赖包,并在package.json下写入配置
yarn global add 模块名npm install 模块名 -g在全局下添加项目的依赖包
yarn add 模块名 --devnpm install 模块名 --save-dev在本目录下添加某个开发时依赖包
yarn remove 模块名npm uninstall 模块名移除本目录下指定的项目依赖包
yarn upgrade 模块名npm update 模块名 --save更新本目录下指定的项目依赖包

yarn add is synchonise while npm install is asynchonise(one by one). so yarn is faster.

yarn can read package from cache.so it can download packages offline. 

yarn can lock version.

list license permission: yarn licenses generate-disclaimer /// yarn licenses ls 

yarn why