A JSON formatter library for Node.js (v1.0.3, stable, no recent updates) offering three serialization styles: 'diffy' (comma-first for reduced version control diffs), 'plain' (standard pretty-print), and 'terse' (compact). Unlike JSON.stringify, it provides a unique comma-first format optimized for diff readability. Minimal dependencies; synchronous only; no streaming support.
npm install format-jsonNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates the three formatting styles (diffy, plain, terse) on a sample object.
Do not use diffy output with JSON.parse; it is for human-readable diffs only.
Use only for small to moderate sized JSON; for large data, consider streaming JSON formatters.
Consider alternatives like prettier or json-stringify-pretty-compact for newer projects.
If you need indentation control, use JSON.stringify with space parameter instead.
npm install format-json --save
Use `const { diffy } = require('format-json');` and ensure correct spelling.Use diffy only for display; for parsing, use plain or terse output.
Use require('format-json').diffy(data) or destructure named exports.No dependency data recorded yet.