Quotes only where they matter
Most strings come out plain. Strings that a YAML parser would read differently — "true", "null", "1e3", and, with the YAML 1.1 guard on, "no", "on" and dates — keep their quotes. Multi-line strings become literal block scalars.
JSON.parse silently keeps the last of two duplicate keys. FormatYAML keeps both and flags them so you can decide.
Questions
- Is the YAML output verified?
- Yes. The YAML is parsed back and compared to the JSON input as a representation graph, including exact big integers.
- Can I choose the indentation?
- Yes, 2 or 4 spaces (or any value from 1 to 8).