A minimal library to format JSON strings with custom indentation. Current stable version 1.0.2, no recent updates. Provides a single `format` function that parses JSON and re-serializes with configurable indent (defaults to spaces). Simpler than alternatives like `json-stringify-pretty-compact`; no CLI or advanced options. Suitable for Node.js and browser, but not actively maintained.
npm install simple-json-formatterNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates formatting a JSON string with 2-space indent using the format function.
Wrap in try-catch or validate JSON via JSON.parse first.
Always pass explicit indent string (e.g., ' ' or '\t').
Use native JSON.stringify(obj, null, indent) or more popular alternatives like prettier.
Use named import: import { format } from 'simple-json-formatter'Ensure first argument is a stringified JSON, e.g., JSON.stringify(obj)
No dependency data recorded yet.