yaml_writer 1.0.0 copy "yaml_writer: ^1.0.0" to clipboard
yaml_writer: ^1.0.0 copied to clipboard

outdated

A library to write YAML documents.

yaml_writer #

pub package Null Safety Codecov CI GitHub Tag New Commits Last Commits Pull Requests Code size License

A library to write YAML documents.

Usage #

A simple usage example:

import 'package:yaml_writer/yaml_writer.dart';

void main() {
  var yamlWriter = YAMLWriter();

  var yamlDoc = yamlWriter.write({
    'name': 'Joe',
    'ids': [10, 20, 30],
    'desc': 'This is\na multiline\ntext',
    'enabled': true,
  });

  print(yamlDoc);
}

OUTPUT:

name: 'Joe'
ids: 
  - 10
  - 20
  - 30
desc: |-
    This is
    a multiline
    text
enabled: true

YAML Strings #

The writer will try to encode strings using the best format depending on the text, avoiding to escape " and using | for multiline texts.

Encoding Objects #

You can use YAMLWriter.toEncodable to convert an Object to an encodable version, similar to what is done by dart:convert JsonEncoder.

If YAMLWriter.toEncodable is not set, it will try to call toJson().

Features and bugs #

Please file feature requests and bugs at the issue tracker.

Author #

Graciliano M. Passos: gmpassos@GitHub.

License #

Dart free & open-source license.

22
likes
0
pub points
92%
popularity

Publisher

unverified uploader

A library to write YAML documents.

Repository (GitHub)
View/report issues

License

unknown (license)

More

Packages that depend on yaml_writer