pubspec_lock_parse 2.1.0 copy "pubspec_lock_parse: ^2.1.0" to clipboard
pubspec_lock_parse: ^2.1.0 copied to clipboard

Simple package for parsing pubspec.lock files with a type-safe API and rich error reporting.

example/main.dart

import 'dart:io';

import 'package:pubspec_lock_parse/pubspec_lock_parse.dart';

void main() {
  // read the pubspec lock of this package (might require calling pub get to generate)
  final lockStr = File('../pubspec.lock').readAsStringSync();
  final lockfile = PubspecLock.parse(lockStr);

  print('Dependencies found in lockfile:');
  for (final packageName in lockfile.packages.keys) {
    print('  $packageName: ${lockfile.packages[packageName]!.version.toString()}');
  }
}
2
likes
130
points
14k
downloads

Publisher

unverified uploader

Weekly Downloads

Simple package for parsing pubspec.lock files with a type-safe API and rich error reporting.

Repository (GitHub)
View/report issues

Documentation

API reference

License

unknown (license)

Dependencies

args, checked_yaml, json_annotation, pub_semver

More

Packages that depend on pubspec_lock_parse