mirror of
https://github.com/pnpm/pnpm.git
synced 2026-05-19 14:20:36 -04:00
1.8 KiB
1.8 KiB
dependencies-hierarchy
Creates a dependencies hierarchy for a symlinked `node_modules`
Install
Install it via npm.
npm install dependencies-hierarchy
API
default: dependenciesHierarchy(projectPath, [opts]): Promise<Hierarchy>
Creates a dependency tree for a project's node_modules.
Arguments:
projectPath- String - The path to the project.[opts.depth]- Number - 0 by default. How deep should thenode_modulesbe analyzed.[opts.only]- 'dev' | 'prod' - Optional. If set todev, then only packages fromdevDependenciesare analyzed. If set toprod, then only packages fromdependenciesare analyzed.
forPackages(packageSelectors, projectPath, [opts]): Promise<Hierarchy>
Creates a dependency tree for a project's node_modules. Limits the results to only the paths to the packages named.
Arguments:
packageSelectors- (string | {name: string, version: string})[] - An array that consist of package names or package names and version ranges. E.g.['foo', {name: 'bar', version: '^2.0.0'}].projectPath- String - The path to the project[opts.depth]- Number - 0 by default. How deep should thenode_modulesbe analyzed.[opts.only]- 'dev' | 'prod' - Optional. If set todev, then only packages fromdevDependenciesare analyzed. If set toprod, then only packages fromdependenciesare analyzed.