Common patterns and usage examples for Codependence.
Check a web app and a Go service
Give each manifest a name in the root .codependencerc. Here the web app uses pnpm and the API uses Go.
{
"config": {
"web": {
"path": "packages/web/package.json",
"manager": "pnpm",
"mode": "precise"
},
"api": {
"path": "services/api/go.mod",
"manager": "go",
"mode": "precise"
}
}
}
- Web app — The web entry checks the package.json inside packages/web.
- Go service — The api entry reads go.mod in services/api. Both paths start at the directory containing this config.
Run codependence to check both manifests. To preview just the Go updates, run:
codependence --target go --update --dryRun
One-off CLI check
codependence --codependencies lodash fs-extra
Wildcard patterns (latest for all matches)
codependence --codependencies '@foo/*' --update
Permissive mode (update all except specific)
codependence --codependencies 'react' 'lodash' --permissive --update
Legacy flat config
.codependencerc:
{
"permissive": true,
"codependencies": ["react", "@types/node"]
}
Run:
codependence --update
Preview changes without modifying files
codependence --update --dryRun
Output as JSON for CI/CD
codependence --format json
Save a report from a failing check
Suppose the app declares lodash 4.17.20 and its policy requires 4.17.21. Save the check result before updating.
codependence --format json --outputFile dependency-report.json
The command exits with status 1. This excerpt from dependency-report.json shows what failed.
{
"status": "outdated",
"exitCode": 1,
"summary": {
"totalPackages": 1,
"outdated": 1,
"upToDate": 0
}
}
- Exit status — A check with an outdated dependency exits with status 1, so CI can fail the job.
- Outdated packages — One dependency in this example needs an update: lodash.
Bypass cache for fresh results
codependence --noCache
Watch mode
codependence --watch