commit | 7bf1948dded60b8bddf998d78f6c701d8bd7a7f5 | [log] [tgz] |
---|---|---|
author | Phil Quitslund <pq@users.noreply.github.com> | Tue Nov 10 12:37:18 2020 -0800 |
committer | GitHub <noreply@github.com> | Tue Nov 10 12:37:18 2020 -0800 |
tree | 93859cb7cf9371fe7984848fc286d5e5c7dcd1ab | |
parent | 7d2e51d130faa488a1cf3edee517778b56460577 [diff] | |
parent | 25628a5070a63c425f6f9f3e7cc709363d2a4fb2 [diff] |
Merge pull request #96 from dart-lang/loader-span-late Avoid a late FileSpan field
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)); }