dupdep
v0.1.1
Published
Check for duplicated dependencies across packages in Yarn Workspaces
Downloads
8
Readme
dupdep
Check for duplicated dependencies across packages in Yarn Workspaces.
Install
$ yarn add dupdep
Usage
type TDuplicatedDependencies = Map</* pkgName */string,
Map</* depName */string, {
range: string,
dependents: Set<{
pkgName: string,
range: string
}>
}>
>
const getDuplicatedDependencies: () => Promise<TDuplicatedDependencies>
import { getDuplicatedDependencies } from 'dupdep'
const result = await getDuplicatedDependencies()
for (const [pkg, deps] of result) {
console.error(pkg)
for (const [dep, { range, dependents }] of deps) {
console.error(` ${dep} is ${range} but`)
for (const dependent of dependents) {
console.error(` ${dependent.pkgName} has ${dependent.range}`)
}
}
}
// foo
// dep1 is ^1.0.0 but
// bar has ^2.0.0
// baz has ^3.0.0