yaml
3.1.4, released 3 months ago by tools.dart.dev
A Dart library for parsing YAML documents into Dart data structures.
What it does
Provides functions to load YAML strings or streams into Dart objects. It supports error recovery and detailed error reporting. The library does not support dumping YAML back to text.
AI-written summary of version 3.1.4, based on the package's README and metadata. Report an inaccuracy
Use it when
- Parsing configuration files in Dart or Flutter apps
- Converting YAML data to Dart maps/lists for further processing
- Reading YAML from network or local files
Skip it when
- When you need to generate YAML output
- When working with very large YAML files that require streaming parsing
Strengths
- Pure Dart implementation, no native dependencies
- Supports error recovery with custom listeners
- Maintained by dart-lang with regular updates
- Compatible with all platforms (web, mobile, desktop)
Weaknesses
- No YAML dumping support
- Limited to parsing, not editing or serializing
- Some edge cases (self-referential collections) still throw exceptions
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 3
import 'package:yaml/yaml.dart';
void main() {
var doc = loadYaml('YAML: YAML Ain\'t Markup Language');
print(doc['YAML']);
}Alternatives
Packages that do the same job and could replace yaml.
- csv_plus
Fast, zero-dependency CSV parser, encoder, streamer, and query engine for Dart.
82Compare - conduit_codable
A library for encoding and decoding dynamic structured data like JSON and YAML into Dart objects.
66Compare - plist_parser
Flutter plugin for parsing XML and binary Apple property list (plist) formats.
65Compare - binary_codec
Dart library for converting standard data types to a binary format and back
40Compare
Works with
Packages commonly used together with yaml: ones it builds on, ones built on it, and its own family.
- source_spanyaml depends on itStandard representation for source code locations, spans, and human-friendly error messages.
- string_scanneryaml depends on itA class for parsing strings using a sequence of patterns.
- globSame familyA file and directory globbing library that supports Bash-style path matching and listing.
- ioSame familyUtilities for the Dart VM Runtime including ANSI colors, file copying, and exit code values.
- test_apiSame familyThe user facing API for structuring Dart tests and checking expectations.
- source_mapsSame familyA Dart library to parse, build, and manipulate source map v3 files.
- htmlSame familyA Dart implementation of an HTML5 parser for strings and bytes.
- boolean_selectorSame familyParses and evaluates simplified Dart-like boolean expression strings.