dump_yaml 0.1.0-beta.4 copy "dump_yaml: ^0.1.0-beta.4" to clipboard
dump_yaml: ^0.1.0-beta.4 copied to clipboard

A configurable library for dumping any Dart object back to YAML.

example/example.dart

import 'dart:async';

import 'package:dump_yaml/dump_yaml.dart';

void main(List<String> args) async {
  final someLazyStream = StreamController<String>();

  final dumper = YamlDumper(
    config: Config.defaults(),
    buffer: YamlBuffer.toStream(someLazyStream),
  );

  dumper.dump([
    'I',
    'love',
    {'streaming': 'things'},
    'lazily',
  ]);

  someLazyStream.close();
  final chunks = await someLazyStream.stream.toList();

  /*
   * Lazy chunks as the dumper walks the YAML representation tree for your
   * object.

[, -,  , I,
, , -,  , love,
, , -,  , streaming, :,  , things,
, , -,  , lazily,
]

*/
  print(chunks);

  /*
  - I
  - love
  - streaming: things
  - lazily
  */
  print(chunks.join());
}
0
likes
160
points
155
downloads

Documentation

API reference

Publisher

verified publisherecacene.dev

Weekly Downloads

A configurable library for dumping any Dart object back to YAML.

Repository (GitHub)
View/report issues
Contributing

Topics

#yaml #json #formatter

License

BSD-3-Clause (license)

Dependencies

collection, meta, rookie_yaml

More

Packages that depend on dump_yaml