Home > @microsoft/node-core-library > PackageJsonLookup > tryLoadNodePackageJsonFor

PackageJsonLookup.tryLoadNodePackageJsonFor() method

This function is similar to PackageJsonLookup.tryLoadPackageJsonFor(), except that it does not report an error if the version field is missing from the package.json file.

Signature:

tryLoadNodePackageJsonFor(fileOrFolderPath: string): INodePackageJson | undefined;

Parameters

Parameter Type Description
fileOrFolderPath string  

Returns:

INodePackageJson | undefined