Skip to content
pubscout

yaml_modify

1.0.1, released 5 years ago by an unverified publisher

A library for modifying YAML files.

WASM-ready
$ flutter pub add yaml_modify
Source repository

What it does

A library for modifying YAML files, for example you can modify pubspec.yaml by this library. It provides utilities to load, modify, and serialize back to YAML strings.

AI-written summary of version 1.0.1, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to programmatically modify and write YAML files like pubspec.yaml
  • You want to parse YAML into a modifiable structure and convert it back to a string

Skip it when

  • You only need to read YAML files without modifying them
  • You need complex schema validation for YAML

Strengths

  • Enables modifying existing YAML files programmatically
  • Null safety supported

Weaknesses

  • Very minimal documentation
  • Limited features mentioned beyond basic modification and serialization

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
1

not documented

import 'package:yaml_modify/yaml_modify.dart';

main() {
  File file = File("pubspec.yaml");
  final yaml = loadYaml(file.readAsStringSync());

  final modifiable = getModifiableNode(yaml);
  modifiable['flutter'] = {
    'assets':['img1.png', 'img2.png']
  };

  final strYaml = toYamlString(modifiable);
  File("pubspec-output.yaml").writeAsStringSync(strYaml);
  print(strYaml);
}

Alternatives

Packages that do the same job and could replace yaml_modify.

Works with

Packages commonly used together with yaml_modify: ones it builds on, ones built on it, and its own family.