https://github.com/jamiemason/syncpack
Consistent dependency versions in large JavaScript Monorepos.
https://github.com/jamiemason/syncpack
linter monorepo npm nx pnpm semver turborepo version-management version-manager yarn
Last synced: 6 months ago
JSON representation
Consistent dependency versions in large JavaScript Monorepos.
- Host: GitHub
- URL: https://github.com/jamiemason/syncpack
- Owner: JamieMason
- License: mit
- Created: 2017-08-17T16:58:10.000Z (about 8 years ago)
- Default Branch: main
- Last Pushed: 2025-05-05T19:06:24.000Z (6 months ago)
- Last Synced: 2025-05-05T19:17:34.461Z (6 months ago)
- Topics: linter, monorepo, npm, nx, pnpm, semver, turborepo, version-management, version-manager, yarn
- Language: Rust
- Homepage: https://jamiemason.github.io/syncpack/
- Size: 8.74 MB
- Stars: 1,638
- Watchers: 6
- Forks: 60
- Open Issues: 26
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# syncpack
Consistent dependency versions in large JavaScript Monorepos.
https://jamiemason.github.io/syncpack
> [!NOTE]
> This is the README for v14-alpha, a Rust rewrite which is due to replace [`v13.x.x`](https://github.com/JamieMason/syncpack/tree/13.x.x?tab=readme-ov-file#syncpack)
## Installation
```bash
npm install --save-dev syncpack@alpha
```
## Commands
> All command line options can be combined to target packages and dependencies in multiple ways.
### [lint](https://jamiemason.github.io/syncpack/command/lint)
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
```bash
# Find all issues in "dependencies" or "devDependencies"
syncpack lint --dependency-types prod,dev
# Only lint issues in "react" specifically
syncpack lint --dependencies react
# Look for issues in dependencies containing "react" in the name
syncpack lint --dependencies '**react**'
# Find issues in scoped packages only
syncpack lint --dependencies '@types/**'
# Find issues everywhere except "peerDependencies"
syncpack lint --dependency-types '!peer'
# Only look for issues where an exact version is used (eg "1.2.3")
syncpack lint --specifier-types exact
# Sort dependencies by how many times they are used
syncpack lint --sort count
# See more examples
syncpack lint --help
# See a short summary of options
syncpack lint -h
```
### [fix](https://jamiemason.github.io/syncpack/command/fix)
Fix every autofixable issue found by `syncpack lint`.
#### Examples
```bash
# Only fix issues in dependencies and devDependencies
syncpack fix --dependency-types prod,dev
# Only fix inconsistencies with exact versions (eg "1.2.3")
syncpack fix --specifier-types exact
# Only fix issues in "react" specifically
syncpack fix --dependencies react
# See more examples
syncpack fix --help
# See a short summary of options
syncpack fix -h
```
### [update](https://jamiemason.github.io/syncpack/command/update)
Update packages to the latest versions from the npm registry, wherever they are in your monorepo.
Semver range preferences are preserved when updating.
#### Examples
```bash
# Accept any update in latest (x.x.x)
syncpack update --target latest
# Only update minor versions (1.x.x)
syncpack update --target minor
# Only update patch versions (1.2.x)
syncpack update --target patch
# Check for outdated dependencies in one package
syncpack update --check --source 'packages/pingu/package.json'
# Update dependencies and devDependencies in the whole monorepo
syncpack update --dependency-types dev,prod
# Only update dependencies with a semver range specifier (^, ~, etc.)
syncpack update --specifier-types range
# Update dependencies where name exactly matches 'react'
syncpack update --dependencies 'react'
# Update dependencies where name contains 'react'
syncpack update --dependencies '**react**'
# Update dependencies with the '@aws-sdk' scope
syncpack update --dependencies '@aws-sdk/**'
# See more examples
syncpack update --help
# See a short summary of options
syncpack update -h
```
### [format](https://jamiemason.github.io/syncpack/command/format)
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
```bash
# Fix every formatting issue in the monorepo
syncpack format
# List all formatting issues in the monorepo
syncpack format --check
# Check the formatting of one package
syncpack format --check --source 'packages/pingu/package.json'
# See more examples
syncpack format --help
# See a short summary of options
syncpack format -h
```
### [list](https://jamiemason.github.io/syncpack/command/list)
Query and inspect all dependencies in your project, both valid and invalid.
#### Examples
```bash
# Sort dependencies by how many times they are used
syncpack list --sort count
# Show every instance of each dependency, not just their names
syncpack list --show instances
# Show dependencies ignored in your syncpack config
syncpack list --show ignored
# Show highest level of detail
syncpack list --show all
# Choose only some values
syncpack list --show hints,statuses
# List all "peerDependencies"
syncpack list --dependency-types peer
# List all types packages
syncpack list --dependencies '@types/**'
# List instances of an exact version being used as a peer dependency
syncpack list --specifier-types exact --show instances --dependency-types peer
# See more examples
syncpack list --help
# See a short summary of options
syncpack list -h
```
## Badges
- [](https://ko-fi.com/C0C4PY4P)
- [](https://www.npmjs.com/package/syncpack)
- [](https://www.npmjs.com/package/syncpack)
- [](https://github.com/JamieMason/syncpack/actions)