How to use the @microsoft/rush-lib.JsonFile.loadJsonFile function in @microsoft/rush-lib

To help you get started, we’ve selected a few @microsoft/rush-lib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github microsoft / rushstack / apps / rush / src / utilities / Package.ts View on Github external
public static createVirtualTempPackage(packageJsonFilename: string, installFolderName: string): Package {
    const packageJson: IPackageJson = JsonFile.loadJsonFile(packageJsonFilename);
    const npmPackage: readPackageTree.PackageNode = {
      children: [],
      error: undefined,
      id: 0,
      isLink: false,
      package: packageJson,
      parent: undefined,
      path: installFolderName,
      realpath: installFolderName
    };
    return Package.createFromNpm(npmPackage);
  }