pub fn emit(document: &Value) -> Result<()>Expand description
Print a document to stdout as pretty JSON with a trailing newline.
Pretty rather than compact because a human reads this output far more often than a
parser does, and jq does not care either way.
When stdout is a terminal, the same document also lands on the clipboard: a pipe or a redirect means a program is consuming the output, but a terminal means a person asked for JSON, and the next thing they usually do is paste it somewhere. The notice goes to stderr and the copy is skipped entirely when piped, so the stdout contract — one document, byte-identical either way — holds.