1.2 KiB
1.2 KiB
title | category | layout | weight | updated |
---|---|---|---|---|
Yarn | JavaScript libraries | 2017/sheet | -3 | 2017-09-08 |
npm equivalents
npm | yarn |
---|---|
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 |
./node_modules/.bin/gulp |
yarn run gulp |
{: .-left-align.-headers} |
yarn add
--dev
--peer
--optional
--exact
--tilde
These options are available for yarn add
.
Workspaces
/* package.json */
"workspaces": [
"packages/*"
]
jest/
├─ package.json
└─ packages/
├─ jest-matcher-utils/
│ └─ package.json
└─ jest-diff/
└─ package.json
(New in 1.0) Allows monorepos to share packages with each other. See: Introducing workspaces
Selective version resolution
/* package.json */
"resolutions": {
"**/sass-brunch/node-sass": "4.5.2"
}
(New in 1.0) Allows you to specify versions for sub-dependencies. See: Selective version resolutions