Skip to content

Latest commit

 

History

History
80 lines (56 loc) · 1.01 KB

5-npm-yarn.md

File metadata and controls

80 lines (56 loc) · 1.01 KB

NPM & Yarn

NPM

Global vs. Local

sudo npm install npm -g
npm install lodash

package.json

npm init

Update versions

Outdated versions

npm outdated

Update version

npm update

Publish to Repository

npm adduser
npm publish

Ignore files

  • add .npmignore

Yarn

  • the "new" JS Package Manager
  • Backward compatible
  • yarn install
  • yarn add ...

Upgrade

yarn upgrade-interactive --latest

Workspaces and Monorepo

MonoRepo

  1. Create a packages folder in root
  2. Copy your projects into the packages folder
  3. Add a packages.json into your root
{
  "private": true,
  "workspaces": ["packages/*"]
}