
Security News
arXiv Is Rate Limiting Authors Following a Flood of AI Slop Submissions
arXiv now limits authors to two submissions a month as AI slop overwhelms moderators, delays good papers, and sparks debate over applying the limit to everyone.
devkits-json-formatter
Advanced tools
Format, validate, and minify JSON. Syntax error detection with position info. Zero-dependency JSON utility for developers.
Format, validate, and minify JSON. Syntax error detection with position info. Zero-dependency JSON utility for developers.
Love these tools? Support development via Open Collective
Get access to 20+ premium tools including SQL to Code, Data Faker, JWT Generator, and more — all for $9 one-time.
💡 Pay with Crypto: BTC, ETH, USDT (TRC-20), SOL accepted. View crypto addresses
This package is part of DevKits — 82+ free developer tools. The online JSON Formatter includes schema validation, tree view, and query/filter tools.
npm install @devkits/json-formatter
const {
format,
minify,
isValid,
pretty,
countKeys,
getSizeInfo,
sortKeys,
formatSorted
} = require('@devkits/json-formatter');
const uglyJson = '{"name":"John","age":30,"city":"NYC"}';
// Format JSON with indentation
const result = format(uglyJson, { indent: 2 });
// {
// success: true,
// result: '{\n "name": "John",\n "age": 30,\n "city": "NYC"\n}'
// }
// Minify JSON
const min = minify(uglyJson);
// { success: true, result: '{"name":"John",...}', saved: 15 }
// Validate JSON
isValid('{"valid": true}');
// { valid: true }
isValid('{invalid}');
// { valid: false, error: 'Unexpected token...', position: {line: 1, column: 2} }
// Pretty print an object
pretty({ name: 'John', age: 30 });
// '{\n "name": "John",\n "age": 30\n}'
// Count keys recursively
const nested = { a: { b: { c: 1 } }, d: [1, 2, 3] };
countKeys(nested);
// 5
// Get size info
getSizeInfo(uglyJson);
// { original: 36, minified: 36, saved: 0, keys: 3 }
// Sort keys alphabetically
const unsorted = { z: 1, a: 2, m: 3 };
sortKeys(unsorted);
// { a: 2, m: 3, z: 1 }
// Format with sorted keys
formatSorted('{"z":1,"a":2}', 2);
// { success: true, result: '{\n "a": 2,\n "z": 1\n}' }
format(jsonString, options)Formats JSON with specified indentation (default: 2 spaces).
Returns {success, result?, error?}.
minify(jsonString)Removes all whitespace from JSON.
Returns {success, result?, error?, saved?}.
isValid(jsonString)Validates JSON syntax with optional error position.
Returns {valid, error?, position?}.
pretty(obj, indent)Pretty prints a JavaScript object as JSON string.
countKeys(obj)Counts all keys in an object recursively.
getSizeInfo(jsonString)Returns size statistics: original size, minified size, bytes saved, key count.
sortKeys(obj)Returns new object with keys sorted alphabetically (recursive).
formatSorted(jsonString, indent)Formats JSON with keys sorted alphabetically.
Free Tools (82+):
| Tool | Description |
|---|---|
| base64-tool | Base64 encode/decode |
| chmod-calculator | Unix permissions converter |
| cron-parser | Cron expression parser |
| csv-json-converter | CSV ↔ JSON converter |
| diff-checker | Text comparison (LCS) |
Unlock 20+ premium tools with a single payment:
💡 Pay with Crypto: BTC, ETH, USDT (TRC-20), SOL accepted
| Product | Description |
|---|---|
| Invoicely | Free invoice generator for freelancers |
| SnapOG | Free OG image generator (20+ templates) |
MIT
FAQs
Format and validate JSON from CLI or stdin — pretty print, minify, and validate JSON files
We found that devkits-json-formatter demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Security News
arXiv now limits authors to two submissions a month as AI slop overwhelms moderators, delays good papers, and sparks debate over applying the limit to everyone.

Research
/Security News
A new GhostAction wave hits hundreds of GitHub repos, expanding CI/CD secret theft to cloud and AI credentials in source code and git history.

Research
/Security News
Tensorlake npm SDK version 0.5.144 was compromised in a ChainDrop / Shai-Hulud attack, delivering credential-stealing malware.