Unlike general-purpose text strippers, this utility is dedicated to compacting RFC 8259 JSON documents into a single-line plain text string. It parses the input with native JSON.parse and serializes it via JSON.stringify without extra spaces or newlines, while preserving all internal string whitespace and array ordering.
For example, given this formatted input:
{
"service": "auth",
"ports": [80, 443],
"enabled": true
}
with recursive key sorting enabled, the minified output becomes:
{"enabled":true,"ports":[80,443],"service":"auth"}
Notice that "enabled", "ports", and "service" are ordered alphabetically for deterministic output (useful for cache keys, HMAC signatures, and environment variable strings), while [80,443] keeps its exact element sequence.