open source is social v-it.org
1// SPDX-License-Identifier: MIT
2// Copyright (c) 2026 sol pbc
3
4export function jsonOk(data) {
5 console.log(JSON.stringify({ ok: true, ...data }, null, 2));
6}
7
8export function jsonError(error, hint) {
9 const obj = { ok: false, error };
10 if (hint) obj.hint = hint;
11 console.log(JSON.stringify(obj, null, 2));
12 process.exitCode = 1;
13}