prettify: Prettify or minify a JSON string

View source: R/prettify.R

prettify, minifyR Documentation

Prettify or minify a JSON string

Description

Prettify adds indentation to a JSON string; minify removes all indentation/whitespace.

Usage

prettify(txt, indent = 4)

minify(txt)

Arguments

txt

JSON string

indent

number of spaces to indent

Examples

myjson <- toJSON(cars)
cat(myjson)
prettify(myjson)
minify(myjson)

jsonlite documentation built on Sept. 20, 2024, 9:07 a.m.