Home > @rushstack/node-core-library > PackageJsonLookup
PackageJsonLookup class
This class provides methods for finding the nearest "package.json" for a folder and retrieving the name of the package. The results are cached.
Signature:
export declare class PackageJsonLookup
Constructors
Constructor | Modifiers | Description |
|---|---|---|
Constructs a new instance of the |
Properties
Property | Modifiers | Type | Description |
|---|---|---|---|
| A singleton instance of |
Methods
Method | Modifiers | Description |
|---|---|---|
Clears the internal file cache. | ||
This function is similar to PackageJsonLookup.loadPackageJson(), except that it does not report an error if the | ||
| A helper for loading the caller's own package.json file. | |
Loads the specified package.json file, if it is not already present in the cache. | ||
Returns the absolute path of a folder containing a package.json file, by looking upwards from the specified fileOrFolderPath. If no package.json can be found, undefined is returned. | ||
If the specified file or folder is part of a package, this returns the absolute path to the associated package.json file. | ||
This function is similar to PackageJsonLookup.tryLoadPackageJsonFor(), except that it does not report an error if the | ||
If the specified file or folder is part of a package, this loads and returns the associated package.json file. |