# npm # yarn
npm install yarn
npm install fred yarn add fred
npm install -D fred yarn add -D fred
npm install -g fred yarn global add fred # global
Most other commands are the same.
yarn upgrade {package}
yarn init -y
yarn workspaces run clean
- yarn hoists everything to top level node_modules
- packages are visible (usable) anywhere within tree
- only creates local
node_modules
if localpackage.json
specifies a different version
- import is done via the workspace name, not the folder name