Nushell
Get Nu!
Getting Started
  • The Nushell Book
  • Command Reference
  • Cookbook
  • Language Reference Guide
  • Contributing Guide
Blog
  • English
  • 中文
  • Deutsch
  • Français
  • Español
  • 日本語
  • Português do Brasil
  • Русский язык
GitHub
Get Nu!
Getting Started
  • The Nushell Book
  • Command Reference
  • Cookbook
  • Language Reference Guide
  • Contributing Guide
Blog
  • English
  • 中文
  • Deutsch
  • Français
  • Español
  • 日本語
  • Português do Brasil
  • Русский язык
GitHub
  • Categories

    • Bits
    • Bytes
    • Chart
    • Conversions
    • Core
    • Database
    • Dataframe
    • Dataframe Or Lazyframe
    • Date
    • Debug
    • Default
    • Env
    • Experimental
    • Expression
    • Filesystem
    • Filters
    • Formats
    • Generators
    • Hash
    • History
    • Lazyframe
    • Math
    • Misc
    • Network
    • Path
    • Platform
    • Plugin
    • Prompt
    • Random
    • Removed
    • Shells
    • Strings
    • System
    • Viewers

to nuon for formats

Converts table data into Nuon (Nushell Object Notation) text.

Signature

> to nuon {flags}

Flags

  • --raw, -r: remove all of the whitespace (overwrites -i and -t)
  • --indent, -i {number}: specify indentation width
  • --tabs, -t {number}: specify indentation tab quantity
  • --serialize, -s: serialize nushell types that cannot be deserialized

Input/output types:

inputoutput
anystring

Examples

Outputs a NUON string representing the contents of this list, compact by default

> [1 2 3] | to nuon
[1, 2, 3]

Outputs a NUON array of ints, with pretty indentation

> [1 2 3] | to nuon --indent 2
[
  1,
  2,
  3
]

Overwrite any set option with --raw

> [1 2 3] | to nuon --indent 2 --raw
[1,2,3]

A more complex record with multiple data types

> {date: 2000-01-01, data: [1 [2 3] 4.56]} | to nuon --indent 2
{
  date: 2000-01-01T00:00:00+00:00,
  data: [
    1,
    [
      2,
      3
    ],
    4.56
  ]
}

A more complex record with --raw

> {date: 2000-01-01, data: [1 [2 3] 4.56]} | to nuon --raw
{date:2000-01-01T00:00:00+00:00,data:[1,[2,3],4.56]}