import { hasOption } from "./command" /** Checks whether the current process was invoked in JSON output mode. */ export function isJsonOutput() { return hasOption(process.argv.slice(2), "--json") } /** * Writes a value as indented JSON to standard output. * * @param value - Serializable value to write. */ export function writeJson(value: unknown) { console.log(JSON.stringify(value, null, 2)) }