commit | fda5b15692ccfa0feb7793a27fe3829b3d0f77fa | [log] [tgz] |
---|---|---|
author | Devon Carew <devoncarew@google.com> | Thu May 12 08:51:45 2022 -0700 |
committer | GitHub <noreply@github.com> | Thu May 12 08:51:45 2022 -0700 |
tree | 1698851f5a7224598101c2309587bc42e52f16fa | |
parent | 0971c06490b9670add644ed62182acd6a5536946 [diff] | |
parent | abc906da23b3ac70106310d508dcb68f9d3f580c [diff] |
Merge pull request #127 from dart-lang/rev_3.1.1 prep for publishing 3.1.1
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)); }