Skip to content

Instantly share code, notes, and snippets.

@kruzyk
Created May 4, 2021 20:04
Show Gist options
  • Select an option

  • Save kruzyk/a326f9a2a96623a6f34e7c3d0a0a46a5 to your computer and use it in GitHub Desktop.

Select an option

Save kruzyk/a326f9a2a96623a6f34e7c3d0a0a46a5 to your computer and use it in GitHub Desktop.
Useful aliases for Yarn

YARN

Basic Commands

alias y="yarn"
alias yi="yarn init -y"

Install And Remove Packages

alias ya="yarn add"
alias yr="yarn remove"

Install Packages In Your devDependencies

alias yad="yarn add -D"

Install And Remove Packages Globally

alias yga="yarn global add"
alias ygr="yarn global remove"

Upgrades Packages To Their Latest Version

alias yu="yarn upgrade"
alias ygu="yarn global upgrade"

Clear The Global Cache

alias ycc="yarn cache clean"

Runs A Defined Package Script

alias yrun="yarn run"

List Installed Packages

alias yl="yarn list --depth=0"
alias ygl="yarn global list --depth=0"

Checks For Outdated Packages

alias yo="yarn outdated"

Updates The Package Version

To change the prefix of the git tag you can use version-tag-prefix.

$ yarn config set version-tag-prefix "v"

Using the yarn version command you can update the version of your package via the command line.

$ yarn version
$ yarn version --major
$ yarn version --minor
$ yarn version --patch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment