commit | 513702674a95e4d6afb51db364473fb1de94dd4a | [log] [tgz] |
---|---|---|
author | Yegor <yjbanov@google.com> | Wed Sep 18 16:38:20 2019 -0700 |
committer | GitHub <noreply@github.com> | Wed Sep 18 16:38:20 2019 -0700 |
tree | 03df3d3fca636c2a4fb1cca6d17bb0dd0f3dec0a | |
parent | 4d016bc3227621e329895db6504dfd78cd9fabca [diff] |
Preserve parsed key order in maps (#57) Preserve key order in YamlMap when parsing YAML.
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)); }