to yaml for formats
Convert table into .yaml/.yml text.
Signature
> to yaml {flags}
Flags
--serialize, -s: Serialize nushell types that cannot be deserialized.--non-roundtrip {string}: How to handle values that are non-roundtrippable.--spec {string}: YAML spec version ('1.1' or '1.2' (default)).--add-directives, -d: Add YAML document directives.--multiple, -m: Given a list, serialize a multi document stream.--indent, -i {int}: Configure the indent.--compact-list-indent: Emit lists with a more compact indentation style.--quote, -q {string}: String quote style ('auto' (default), 'single' or 'double')
Input/output types:
| input | output |
|---|---|
| any | string |
Examples
Outputs a YAML string representing the contents of this table.
> [[foo bar]; ["1" "2"]] | to yaml
- foo: "1"
bar: "2"Convert a nushell specific type into YAML.
> $.1.abc | to yaml
!cell-path $.1.abc