yaml_writer
YAML दस्तावेज़ लिखने के लिए एक पुस्तकालय, ऑब्जेक्ट संकोडिंग और 'dart:convert' के 'Converter' का समर्थन करता है।
YAML दस्तावेज़ लिखने के लिए एक पुस्तकालय।
^5.1.1^1.25.15^5.0.2^1.11.1^3.1.3यह अंग्रेज़ी मूल स्नैपशॉट है। नवीनतम सामग्री GitHub पर देखें।
pub package Null Safety Codecov Dart CI GitHub Tag New Commits Last Commits Pull Requests Code size License
A library to write YAML documents, supporting Object encoding and dart:convert Converter.
A simple usage example:
import 'package:yaml_writer/yaml_writer.dart';
void main() {
final yamlWriter = YamlWriter();
final 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
The writer will try to encode strings using the best format depending on the text,
avoiding to escape " and using | for multiline texts.
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().
Please file feature requests and bugs at the issue tracker.
Graciliano M. Passos: gmpassos@GitHub.
Liplum: liplum@GitHub
Dart free & open-source license.