to yml

For formats.

Convert table into .yaml/.yml text.

Command Type

built-in

Signature

> to yml {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 yml
- foo: "1"
  bar: "2"

Convert a nushell specific type into YAML.

> $.1.abc | to yml
!cell-path $.1.abc

Ported from nushell/nushell.github.io. Copyright (c) 2021 Nushell Project. MIT License.