npm | yarn |
---|---|
npm init |
yarn init |
npm install |
yarn |
npm install gulp --save |
yarn add gulp |
npm install gulp --save-dev --save-exact |
yarn add gulp --dev --exact |
npm install -g gulp |
yarn global add gulp |
npm update |
yarn upgrade |
./node_modules/.bin/gulp |
yarn run gulp |
{: .-left-align.-headers} |
--no-lockfile
--pure-lockfile
--frozen-lockfile
--silent
--offline
--update-checksums
--check-files
--flat
--force
--ignore-scripts
--modules-folder <path>
--production[=true|false]
These options are available for yarn install
.
--dev
--peer
--optional
--exact
--tilde
These options are available for yarn add
.
In package.json
:
{: .-setup}
"workspaces": [
"packages/*"
]
jest/
├─ package.json
└─ packages/
├─ jest-matcher-utils/
│ └─ package.json
└─ jest-diff/
└─ package.json
{: .-box-chars}
(New in 1.0) Allows monorepos to share packages with each other. See: Introducing workspaces
In package.json
:
{: .-setup}
"resolutions": {
"**/sass-brunch/node-sass": "4.5.2"
}
(New in 1.0) Allows you to specify versions for sub-dependencies. See: Selective version resolutions
yarn create react-app hello
Install create-react-app
and runs it. See: yarn create
Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️