pubspec_yaml 2.0.1

Dart native js
Flutter Android iOS web

Dart library to access and manipulate content of pubpec.yaml files

example/main.dart

import 'dart:io';

import 'package:pubspec_yaml/pubspec_yaml.dart';

// ignore_for_file: avoid_print

void main() {
  final pubspecYaml = File('pubspec.yaml').readAsStringSync().toPubspecYaml();

  final productionOverrides = pubspecYaml.dependencyOverrides.where(
    (override) => pubspecYaml.dependencies.any((
      productionDependency,
    ) =>
        productionDependency.package() == override.package()),
  );

  if (productionOverrides.isEmpty) {
    print('SUCCESS: No overrides of production dependencies detected');
  } else {
    print('WARNING: Overrides of production dependencies detected:');
    productionOverrides.forEach(print);
  }
}
8
likes
100
pub points
78%
popularity

Dart library to access and manipulate content of pubpec.yaml files

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

alexei.sintotski@gmail.com

License

MIT (LICENSE)

Dependencies

collection, functional_data, json2yaml, meta, plain_optional, sum_types, yaml

More

Packages that depend on pubspec_yaml