Rush StackShopBlogEvents
Skip to main content

Home > @rushstack/node-core-library > PackageJsonLookup > loadPackageJson

PackageJsonLookup.loadPackageJson() method

Loads the specified package.json file, if it is not already present in the cache.

Signature:

loadPackageJson(jsonFilename: string): IPackageJson;

Parameters

ParameterTypeDescription
jsonFilenamestringa relative or absolute path to a package.json file

Returns:

IPackageJson

Remarks

Unless IPackageJsonLookupParameters.loadExtraFields was specified, the returned IPackageJson object will contain a subset of essential fields. The returned object should be considered to be immutable; the caller must never modify it.