yaml_modify
1.0.1, released 5 years ago by an unverified publisher
A library for modifying YAML files.
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.
- pubspec_parse
Parse pubspec.yaml files with a type‑safe API and detailed error reporting.
93Compare - pubspec_manager
Type-safe API to read, modify, and write pubspec.yaml while preserving comments.
78Compare - flutter_oss_licenses
Generates a detailed OSS license list from pubspec.yaml and lock files.
65Compare - config
Typed CLI argument and config file parser with env support
84Compare
Works with
Packages commonly used together with yaml_modify: ones it builds on, ones built on it, and its own family.