All notes
Yar

Installation


# Mac OS
brew update
brew install yarn
export PATH="$PATH:`yarn global bin`"

yarn --version

Quick Start


# Starting a new project
yarn init

# Adding a dependency

yarn [install]

# Updating a dependency
yarn upgrade [package]
yarn upgrade [package]@[version]
yarn upgrade [package]@[tag]

# Removing a dependency
yarn remove [package]

##########

# Installing all the dependencies of project
yarn
# or
yarn install

# Generate yarn.lock
yarn generate-lock-entry

add

Will also update your package.json and your yarn.lock. wcfNote: there is no -S option, since it is implicit.


yarn add [package]
yarn add [package]@[version]
yarn add [package]@[tag]
# There is no -S, yarn add will turn on --save by default.
# -D, --dev
# -P, --peer
# -O, --optional
# -E, --exact  install exact version
# -T, --tilde  install most recent release with the same minor version

# Would accept 1.2.9 but not 1.3.0.
yarn add [email protected] --tilde

# Other inputs
yarn add file:/path/to/local/folder
yarn add file:/path/to/local/tarball.tgz
yarn add gitRemoteUrl#branch/commit/tag

# Add globally
yarn global add pkgName