privatenumber

Surgically edit JSON & JSONC strings while preserving whitespace, comments, and formatting

19
0
100% credibility
Found Mar 03, 2026 at 19 stars -- GitGems finds repos before they trend. Get early access to the next one.
Sign Up Free
AI Analysis
TypeScript
AI Summary

Doctor JSON is a JavaScript library that enables editing JSON and JSONC content as plain objects while surgically preserving the original formatting, comments, whitespace, and structure.

How It Works

1
📖 Discover Doctor JSON

You find a helpful tool that lets you tweak your project's settings files without ruining their nice layout, notes, and spacing.

2
🧰 Add the tool

You bring this smart editor into your project setup with ease.

3
📂 Open your settings file

You load a config file like your project list or build settings into the tool, keeping all its charm intact.

4
✏️ Edit just what you need

You update versions, add new items, rearrange lists, or rename things naturally, feeling confident it won't mess up the rest.

5
💾 Save your updates

You write the file back out, and only your changes appear – everything else stays perfectly as it was.

🎉 Beautiful file preserved

Your settings file now has your improvements while looking exactly like before, ready for your project.

Sign up to see the full architecture

4 more

Sign Up Free

Star Growth

See how this repo grew from 19 to 19 stars Sign Up Free
Repurpose This Repo

Repurpose is a Pro feature

Generate ready-to-use prompts for X threads, LinkedIn posts, blog posts, YouTube scripts, and more -- with full repo context baked in.

Unlock Repurpose
AI-Generated Review

What is doctor-json?

Doctor-json is a TypeScript library for surgically editing JSON and JSONC strings while preserving whitespace, comments, and formatting. Parse any config file to a plain JavaScript object, mutate it with standard operations like assignment or deletion, then stringify to patch only your changes—leaving the rest byte-identical. No proxies or special syntax; it just works with normal JS, including arrays, spreads, and loops.

Why is it gaining traction?

Unlike JSON.parse plus stringify, which nukes all formatting and comments, doctor-json diffs your edits against the original and applies minimal patches. Developers love how sortKeys respects blank-line groups and moves comments with keys, while rename swaps names without shifting positions or losing notes. JSONC support means trailing commas and inline comments survive untouched.

Who should use this?

Node.js tool authors updating package.json dependencies or scripts without reformatting everything. TypeScript devs tweaking tsconfig.json targets and excludes in build pipelines. Anyone scripting config edits where human-readable whitespace and comments matter.

Verdict

Grab doctor-json if you edit JSON/JSONC configs programmatically—its examples and API docs make it dead simple to adopt. At 19 stars and 1.0% credibility score, it's early and unproven for production, but the preservation features nail a real pain point worth prototyping.

(178 words)

Sign up to read the full AI review Sign Up Free

Similar repos coming soon.