commit | 585bfe9085cebb48891f7b3cf7398e9aff2da161 | [log] [tgz] |
---|---|---|
author | Danny Tuppeny <danny@tuppeny.com> | Mon Feb 08 18:18:27 2021 +0000 |
committer | Danny Tuppeny <danny@tuppeny.com> | Thu Feb 11 17:17:05 2021 +0000 |
tree | bef4d6f0bafadb7c01a1fe4267596a63224a145e | |
parent | e0d32ae1d0e57132feefa149e6244200a97501bc [diff] |
Use YamlExceptions directly + tidy up error reporting
A parser for YAML.
Use loadYaml
to load a single document, or loadYamlStream
to load a stream of documents. For example:
import 'package:yaml/yaml.dart'; main() { var doc = loadYaml("YAML: YAML Ain't Markup Language"); print(doc['YAML']); }
This library currently doesn't support dumping to YAML. You should use json.encode
from dart:convert
instead:
import 'dart:convert'; import 'package:yaml/yaml.dart'; main() { var doc = loadYaml("YAML: YAML Ain't Markup Language"); print(json.encode(doc)); }