| hide_title | true |
|---|---|
| custom_edit_url | |
| pagination_prev | |
| pagination_next |
Home > @rushstack/node-core-library > PackageJsonLookup > tryGetPackageJsonFilePathFor
If the specified file or folder is part of a package, this returns the absolute path to the associated package.json file.
Signature:
tryGetPackageJsonFilePathFor(fileOrFolderPath: string): string | undefined;|
Parameter |
Type |
Description |
|---|---|---|
|
fileOrFolderPath |
string |
a relative or absolute path to a source file or folder that may be part of a package |
Returns:
string | undefined
an absolute path to * package.json file
The package folder is determined using the same algorithm as PackageJsonLookup.tryGetPackageFolderFor()<></>.