Gathering detailed insights and metrics for check-dependency-version-consistency
Gathering detailed insights and metrics for check-dependency-version-consistency
Gathering detailed insights and metrics for check-dependency-version-consistency
Gathering detailed insights and metrics for check-dependency-version-consistency
CLI tool which checks that dependencies are on consistent versions across a monorepo / npm/pnpm/Yarn workspace.
npm install check-dependency-version-consistency
Typescript
Module System
Min. Node Version
Node Version
NPM Version
TypeScript (95.65%)
JavaScript (4.35%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
76 Stars
1,046 Commits
6 Forks
2 Watchers
9 Branches
7 Contributors
Updated on Jun 23, 2025
Latest Version
5.0.1
Package Id
check-dependency-version-consistency@5.0.1
Unpacked Size
75.66 kB
Size
16.13 kB
File Count
27
NPM Version
10.9.2
Node Version
22.16.0
Published on
Jun 22, 2025
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
24
This CLI tool enforces the following aspects of consistency across a monorepo with npm / pnpm / Yarn workspaces:
eslint
should specify the same version for it.package1
in a workspace depends on another package package2
in the workspace, package1
should request the current version of package2
.To install:
1yarn add --dev check-dependency-version-consistency
To run, use this command and optionally pass the path to the workspace root (where the package.json
file containing workspaces
or pnpm-workspace.yaml
is located):
1yarn check-dependency-version-consistency .
If there are no inconsistencies, the program will exit with success.
If there are any inconsistencies, the program will exit with failure and output the mismatching versions.
package.json
(workspace root):
1{ 2 "workspaces": ["*"], 3 "scripts": { 4 "lint": "npm-run-all --continue-on-error --aggregate-output --parallel \"lint:*\"", 5 "lint:dependency-versions": "check-dependency-version-consistency .", 6 "lint:dependency-versions:fix": "npm-run-all \"lint:dependency-versions --fix\"" 7 }, 8 "devDependencies": { 9 "check-dependency-version-consistency": "*", 10 "npm-run-all": "*" 11 } 12}
package1/package.json
:
1{ 2 "name": "package1", 3 "devDependencies": { 4 "eslint": "^8.0.0" 5 }, 6 "dependencies": { 7 "package2": "^0.0.0" 8 } 9}
package2/package.json
:
1{ 2 "name": "package2", 3 "version": "1.0.0", 4 "devDependencies": { 5 "eslint": "^7.0.0" 6 } 7}
package3/package.json
:
1{ 2 "name": "package3", 3 "devDependencies": { 4 "eslint": "^7.0.0" 5 } 6}
Output:
1Found 2 dependencies with mismatching versions across the workspace. Fix with `--fix`. 2╔════════╤════════╤════════════════════╗ 3║ eslint │ Usages │ Packages ║ 4╟────────┼────────┼────────────────────╢ 5║ ^8.0.0 │ 1 │ package1 ║ 6╟────────┼────────┼────────────────────╢ 7║ ^7.0.0 │ 2 │ package2, package3 ║ 8╚════════╧════════╧════════════════════╝ 9╔══════════╤════════╤══════════╗ 10║ package2 │ Usages │ Packages ║ 11╟──────────┼────────┼──────────╢ 12║ 1.0.0 │ 1 │ package2 ║ 13╟──────────┼────────┼──────────╢ 14║ ^0.0.0 │ 1 │ package1 ║ 15╚══════════╧════════╧══════════╝
These options are available on the CLI and as parameters to the Node API.
Name | Description |
---|---|
--dep-type | Type of dependency to check (dependencies , devDependencies , optionalDependencies , peerDependencies (optional), resolutions ) (default: dependencies , devDependencies , optionalDependencies , resolutions ) (option can be repeated). |
--fix | Whether to autofix inconsistencies (using latest version present). |
--ignore-dep | Dependency to ignore mismatches for (option can be repeated). |
--ignore-dep-pattern | RegExp of dependency names to ignore mismatches for (option can be repeated). |
--ignore-package | Workspace package to ignore mismatches for (option can be repeated). |
--ignore-package-pattern | RegExp of package names to ignore mismatches for (option can be repeated). |
--ignore-path | Workspace-relative path of packages to ignore mismatches for (option can be repeated). |
--ignore-path-pattern | RegExp of workspace-relative path of packages to ignore mismatches for (option can be repeated). |
1import { CDVC } from 'check-dependency-version-consistency'; 2 3const cdvc = new CDVC(path, options); 4 5const result = cdvc.getDependency('eslint'); 6 7// Result could look like this: 8const result = { 9 isFixable: true, 10 isMismatching: true, 11 name: 'eslint', 12 versions: [ 13 { 14 packages: [{ pathRelative: 'packages/package1' }, { pathRelative: 'packages/package2' }], 15 version: '^7.0.0', 16 }, 17 { 18 packages: [{ pathRelative: 'packages/package3' }], 19 version: '^8.0.0', 20 }, 21 ], 22};
CDVC Class Constructor Parameter | Type | Description |
---|---|---|
path | string | Path to the workspace root (where the package.json file containing workspaces or pnpm-workspace.yaml is located). |
options | object | See Options. |
CDVC Class Member | Description |
---|---|
getDependencies() | Returns an array of all dependencies in the workspace. |
getDependency(name: string) | Returns an object with information about an individual dependency. |
hasMismatchingDependenciesFixable | true if there are any dependencies with mismatching versions that are autofixable. |
hasMismatchingDependenciesNotFixable | true if there are any dependencies with mismatching versions that are not autofixable. |
hasMismatchingDependencies | true if there are any dependencies with mismatching versions. |
toFixedSummary() | Returns a string summary of the mismatching dependency versions that were fixed (if the fix option was specified). |
toMismatchSummary() | Returns a string of human-readable tables describing the mismatching dependency versions. |
Dependency Object Property | Description |
---|---|
isFixable | true if the mismatching versions of this dependency are autofixable. |
isMismatching | true if there are multiple versions of this dependency. |
name | The dependency's name. |
versions | A list of the versions present of this dependency and the packages each is found in, in the form of: { version: string, packages: { pathRelative: string }[] } . |
See lib/cli.ts
for an example of how to use it.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
30 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Reason
no binaries found in the repo
Reason
packaging workflow detected
Details
Reason
SAST tool is run on all commits
Details
Reason
2 existing vulnerabilities detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 4
Details
Reason
Found 0/17 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
security policy file not detected
Details
Reason
license file not detected
Details
Reason
project is not fuzzed
Details
Score
Last Scanned on 2025-07-14
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More