syncpack
Consistent dependency versions in large JavaScript Monorepos.
https://syncpack.dev
Syncpack is used by AWS, Cloudflare, DataDog, Electron, GoDaddy, LiveStore, Lottie, Microsoft, PostHog, Qwik, Raycast, Salesforce, TopTal, Vercel, VoltAgent, WooCommerce and others.
Installation
npm install --save-dev syncpack
Guides
Commands
All command line options can be combined to target packages and dependencies in multiple ways.
Ensure that multiple packages requiring the same dependency define the same version, so that every package requires eg. react@17.0.2, instead of a combination of react@17.0.2, react@16.8.3, and react@16.14.0.
Examples
syncpack lint --dependency-types prod,dev
syncpack lint --dependencies react
syncpack lint --dependencies '**react**'
syncpack lint --dependencies '@types/**'
syncpack lint --dependency-types '!peer'
syncpack lint --specifier-types exact
syncpack lint --sort count
syncpack lint --help
syncpack lint -h
Fix every autofixable issue found by syncpack lint.
Examples
syncpack fix --dependency-types prod,dev
syncpack fix --specifier-types exact
syncpack fix --dependencies react
syncpack fix --help
syncpack fix -h
Update packages to the latest versions from the npm registry, wherever they are in your monorepo.
Semver range preferences are preserved when updating.
Examples
syncpack update --target latest
syncpack update --target minor
syncpack update --target patch
syncpack update --check --source 'packages/pingu/package.json'
syncpack update --dependency-types dev,prod
syncpack update --specifier-types range
syncpack update --dependencies 'react'
syncpack update --dependencies '**react**'
syncpack update --dependencies '@aws-sdk/**'
syncpack update --help
syncpack update -h
Organise package.json files according to a conventional format, where fields appear in a predictable order and nested fields are ordered alphabetically. Shorthand properties are used where available, such as the "repository" and "bugs" fields.
Examples
syncpack format
syncpack format --check
syncpack format --check --source 'packages/pingu/package.json'
syncpack format --help
syncpack format -h
Query and inspect all dependencies in your project, both valid and invalid.
Examples
syncpack list --sort count
syncpack list --show instances
syncpack list --show ignored
syncpack list --show all
syncpack list --show hints,statuses
syncpack list --dependency-types peer
syncpack list --dependencies '@types/**'
syncpack list --specifier-types exact --show instances --dependency-types peer
syncpack list --help
syncpack list -h
Output the state of every instance of every dependency as a JSON object, one per line. This command is best used with tools like jq for filtering and processing.
Examples
syncpack json
syncpack json --dependencies '@aws-sdk/**'
syncpack json | jq -r '.dependencyType' | sort | uniq -c
syncpack json --help
syncpack json -h
Badges