home-lab/packages/lab-tool/utils/json/pretty-print.scm
2025-06-16 13:43:21 +02:00

13 lines
459 B
Scheme

;; utils/json/pretty-print.scm - JSON pretty printing
(define-module (utils json pretty-print)
#:use-module (json)
#:export (json-pretty-print))
;; Impure function: Pretty print JSON to current output port
;; Input: obj (scheme object)
;; Output: unspecified (side effect: prints to current-output-port)
(define (json-pretty-print obj)
"Pretty print JSON object to current output port"
(scm->json obj (current-output-port) #:pretty #t)
(newline))