Yarn draft

Last modified 3 months ago / Edit on Github
Danger icon
This is a draft, the content is not complete and of poor quality!

yarn creates yarn.lock (whereas npm creates package-lock.json). They both use package.json with the same structure (but with different algorithms).

# Install yarn
npm install --global yarn
yarn --version
# Install all packages in package.json
yarn install # or just "yarn"

# Forcing a re-download of all packages
yarn install --force

# Install only prod dependencies
yarn install --production

# Add a single package
yarn add <package>
yarn add -D <package> # in devDependencies
# Remove a package
yarn remove <package>
# Check version of a package
yarn list # all
yarn list --depth=0
# (maybe)
yarn check <package>
# npx like?
# No, just use npx!
# Update/Upgrade all package (with interactive interface)
# Require: yarn.lock & package-lock.json removed & run "yarn" once
yarn upgrade-interactive --latest

# Upgrade a single package (not update package.json when using caret range, i.e. "^")
yarn upgrade package_name --latest

# Show list of versions + update package.json
yarn upgrade notion-client@^ # notion-client is the package

# If you wanna automatically update package.json
# Don't use range in the version of the package, ie. just "notion-client": "6.16.0" instead of
# "^6.16.0" or "~6.16.0" and then run
yarn upgrade notion-client --latest
yarn version --patch # 1.0.0 -> 1.0.1 (fixes)
yarn version --minor # 1.0.1 -> 1.1.0 (new features )
yarn version --major # 1.1.0 -> 2.0.0 (completely new APIs)

💬 Comments

Support Thi Support Thi