You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+15-1Lines changed: 15 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -112,8 +112,10 @@ Found 2 dependencies with mismatching versions across the workspace. Fix with `-
112
112
113
113
## Options
114
114
115
+
These options are available on the CLI and as parameters to the [Node API](#node-api).
116
+
115
117
| Name | Description |
116
-
|---|--- |
118
+
|:--|:-- |
117
119
|`--fix`| Whether to autofix inconsistencies (using latest version present). |
118
120
|`--ignore-dep`| Dependency to ignore mismatches for (option can be repeated). |
119
121
|`--ignore-dep-pattern`| RegExp of dependency names to ignore mismatches for (option can be repeated). |
@@ -122,6 +124,18 @@ Found 2 dependencies with mismatching versions across the workspace. Fix with `-
122
124
|`--ignore-path`| Workspace-relative path of packages to ignore mismatches for (option can be repeated). |
123
125
|`--ignore-path-pattern`| RegExp of workspace-relative path of packages to ignore mismatches for (option can be repeated). |
124
126
127
+
## Node API
128
+
129
+
| Function | Description |
130
+
| :-- | :-- |
131
+
|`check(path, options)`| Checks for inconsistencies across a workspace. Optionally fixes them. Returns lists of inconsistencies: a complete list, a fixable list, and an un-fixable list. |
132
+
|`mismatchingVersionsToDetailedSummary(versions)`| Returns a string of human-readable tables describing mismatching dependency versions. |
133
+
|`mismatchingVersionsToFixedSummary(versions)`| Returns a string summary of the mismatching dependency versions that were fixed. |
134
+
135
+
More information about parameters and return values can be found in the types and JSDoc comments.
136
+
137
+
See an example of how these functions are used in [`lib/cli.ts`](./lib/cli.ts).
138
+
125
139
## Related
126
140
127
141
*[npm-package-json-lint](https://github.com/tclindner/npm-package-json-lint) — use this complementary tool to enforce that your dependency versions use consistent range types (i.e. [prefer-caret-version-dependencies](https://npmpackagejsonlint.org/docs/rules/dependencies/prefer-caret-version-dependencies), [prefer-caret-version-devDependencies](https://npmpackagejsonlint.org/docs/rules/dependencies/prefer-caret-version-devDependencies))
0 commit comments