mirror of
https://github.com/pnpm/pnpm.git
synced 2026-05-01 12:36:29 -04:00
a2fcae004e950d4b3ac9dad7fb4fd0174fbb7353
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.
License
Languages
TypeScript
98.8%
JavaScript
0.8%
Shell
0.4%