parsePackageConfigSync function

PackageConfig parsePackageConfigSync(
  1. Directory directory
)

Parse the package config of the given directory.

Throws if the parsing fails, such as if the file is badly formatted or does not exists.

Implementation

PackageConfig parsePackageConfigSync(Directory directory) {
  final packageConfigFile = directory.packageConfig;
  return PackageConfig.parseBytes(
    packageConfigFile.readAsBytesSync(),
    packageConfigFile.uri,
  );
}