Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save princeppy/b4fa1f2ae58179b87d6c2658386243c0 to your computer and use it in GitHub Desktop.
Save princeppy/b4fa1f2ae58179b87d6c2658386243c0 to your computer and use it in GitHub Desktop.
yarn cheatsheet
title subtitle author date source
npm vs Yarn Command Translation Cheat Sheet
CLI commands comparison
yarn
July 2, 2017

npm vs Yarn Command Translation Cheat Sheet

npm Yarn
npm install yarn install
(N/A) yarn install --flat
(N/A) yarn install --har
(N/A) yarn install --no-lockfile
(N/A) yarn install --pure-lockfile
npm install [package] (N/A)
npm install --save [package] yarn add [package]
npm install --save-dev [package] yarn add [package] [--dev/-D]
(N/A) yarn add [package] [--peer/-P]
npm install --save-optional [package] yarn add [package] [--optional/-O]
npm install --save-exact [package] yarn add [package] [--exact/-E]
(N/A) yarn add [package] [--tilde/-T]
npm install --global [package] yarn global add [package]
npm update --global yarn global upgrade
npm rebuild yarn install --force
npm uninstall [package] (N/A)
npm uninstall --save [package] yarn remove [package]
npm uninstall --save-dev [package] yarn remove [package]
npm uninstall --save-optional [package] yarn remove [package]
npm cache clean yarn cache clean
rm -rf node_modules && npm install yarn upgrade
(N/A) yarn upgrade-interactive
npm --version yarn version
npm version major yarn version --major
npm version minor yarn version --minor
npm version patch yarn version --patch
npm run script-name yarn run script-name
npm init yarn init
npm pack yarn pack
npm link yarn link
npm outdated yarn outdated
npm publish yarn publish
npm run yarn run
npm cache clean yarn cache clean
npm login yarn login
(N/A) yarn logout
npm test yarn test
npm install --production yarn --production
npm info yarn info
(N/A) yarn why pkg-name
Builds a dependency graph on why this package is being used
(N/A) yarn clean
  BFrees up space by removing unnecessary files and folders from dependencies
(N/A) yarn licenses ls
  BInspect the licenses of your dependencies
(N/A) yarn licenses generate-disclaimer 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment