1.0.0 • Published 4 years ago

dependency-package-path v1.0.0

Weekly downloads
4
License
MIT
Repository
github
Last release
4 years ago

dependency-package-path

Find where a dependency is stored - either in node_modules below the package, or "hoisted" above. Returns the directory hosting package.json.

Usage

npx dependency-package-path [options]

Get path to package.json for identified dependency

Options

  • -w --working-path \<path> Working path for node package to examine (default: .)

dependency-package-path - v1.0.0

Index

Functions

Functions

dependencyPath

dependencyPath(key: string, cwd: string): string

Defined in index.ts:9

Get the path to a node dependency, traversing up the tree as expected

internal

Parameters:

NameTypeDefaultDescription
keystring-Identifier of the node package to find
cwdstringprocess.cwd()Context for working directory (changes with recursive calls)

Returns: string