Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

jsondoctor

Latest version: v1.0.0

Overview

Last scanned
23 Nov 2026
Published
23 Nov 2026
npm package Publisher: mayankj936
2 Versions

Scan summary

jsondoctor was last scanned on 23 Nov 2026 at version 1.0.0. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 2 versions, all published on 23 Nov 2026.
  • Findings: No rules fired in version 1.0.0.

Versions

2 versions published
Versions and the rules that fired in each
VersionPublishedStatus
1.0.0 LATEST 23 Nov 2026 No rules fired
0.0.0-stage 23 Nov 2026 Not shown

No rules fired in 1.0.0

Findings

Findings for v1.0.0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 1.0.0; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

JSONDoctor

The Complete JSON Debugging & Analysis Toolkit

  JSONDoctor
  Understand your JSON. Detect its problems.
  Compare its structure. Transform it confidently.

JSONDoctor is a standalone JavaScript library and CLI for inspecting, validating, comparing, repairing, and transforming JSON. It runs entirely offline.

Package name on npm: jsondoctor\ (jsondoctor-js was also unused; this project uses jsondoctor so the install name matches the jsondoctor binary.)

Requires Node.js 18.18+.

Problem

JSON is everywhere: APIs, configs, databases, tests. Developers still spend time on trailing commas, opaque parse errors, huge nested payloads, and “what actually changed?” diffs. JSONDoctor puts those jobs in one toolkit with structured results instead of log-only helpers.

Features

  • Syntax validation with line and column
  • Pretty-print and minify
  • Deep object/array comparison and a path-based diff
  • Diagnostics plus safe, explicit repairs only
  • Flatten / unflatten with escaped keys
  • JSONPath-subset queries ($, dots, indices, brackets, [*])
  • JSON Schema draft-07 validation (Ajv)
  • Structural statistics
  • CLI with exit codes, --json, and no accidental overwrites

Installation

npm install jsondoctor

Global CLI (optional):

npm install -g jsondoctor

Quick start

import JSONDoctor, { validate, compare, flatten, get } from 'jsondoctor';

const result = JSONDoctor.validate('{"name":"John","age":22}');
// { valid: true, error: null, data: { name: "John", age: 22 } }

JSONDoctor.format('{"user":{"name":"John"}}');
JSONDoctor.compare(oldData, newData);
JSONDoctor.get(data, '$.user.profile.email');

Input conventions

API Accepts
validate, diagnose, repair JSON strings only
format, minify JSON string or parsed JSON value
compare, diff, flatten, get, stats, validateSchema Parsed JSON values, or JSON strings that will be parsed first
unflatten Flat object of path keys

On invalid syntax, format / minify / compare / etc. throw InvalidJsonError with line and column. validate never throws for bad JSON; it returns { valid: false, error }.

API

validate(jsonString)
JSONDoctor.validate('{"name":"John",}');
// {
//   valid: false,
//   error: { message, line, column, position, rawMessage },
//   data: null
// }

Uses JSON.parse as the authoritative parser. Trailing commas, unquoted keys, and invalid escapes fail because native parsing fails.

format(input, options?) / minify(input)

Default indent is 2. indent may be 4 or a string such as '\t'.

compare(oldData, newData, options?)
JSONDoctor.compare(
  { name: 'John', age: 22, address: { city: 'Delhi', country: 'India' } },
  { name: 'John', age: 23, address: { city: 'Mumbai', country: 'India' }, active: true }
);

Returns added, removed, modified, optional unchanged paths, and summary.

Options:

  • caseSensitiveKeys (default true)
  • ignoreKeys
  • ignorePaths — exact paths, $.meta.*, $.features[*].temp, or $.features.[].temp
  • ignoreArrayOrder (opt-in; default comparison is index-based)
  • includeUnchanged (default true)
  • maxDepth (default 64)

Reordered arrays are not equal unless ignoreArrayOrder is set.

diff(oldData, newData, options?)

Same engine as compare, with a changes[] list (added / removed / modified) and counts.

diagnose(jsonString) / repair(jsonString)

Diagnosis is not a repair. Repair only:

  • strips a UTF-8 BOM
  • removes trailing commas
  • converts unambiguous single-quoted strings
  • quotes identifier keys

It will not invent missing values or close ambiguous structures. Success:

{
  success: true,
  original: '...',
  repaired: '...',
  changes: [],
  warnings: []
}
flatten(data, options?) / unflatten(flat, options?)
JSONDoctor.flatten({
  user: { profile: { name: 'John', age: 22 } },
  active: true
});
// { "user.profile.name": "John", "user.profile.age": 22, active: true }

Arrays use [index]. Keys containing ., \, [, or ] are backslash-escaped so round-trips stay reversible. Conflicting paths throw TransformationConflictError instead of overwriting.

get(data, path)

Documented JSONPath subset (not the full standard):

  • $.user.name
  • $.users[0].email
  • $.products[2].price
  • $['user']['name']
  • $.users[*].name

Missing paths return undefined. Wildcards return an array.

validateSchema(data, schema)

JSON Schema draft-07 via Ajv. Syntax-valid JSON can still fail schema checks.

stats(data)

Counts objects, keys, arrays, array items, strings, numbers, booleans, nulls, empty containers, max depth, UTF-8 serialized size, and the largest nested sections.

CLI

jsondoctor validate ./data.json
jsondoctor format ./data.json
jsondoctor minify ./data.json
jsondoctor compare ./old.json ./new.json
jsondoctor diff ./old.json ./new.json
jsondoctor diagnose ./broken.json
jsondoctor repair ./broken.json --out ./fixed.json
jsondoctor flatten ./data.json
jsondoctor stats ./data.json
jsondoctor schema ./data.json ./schema.json
jsondoctor get ./data.json "$.user.name"

--json prints machine-readable output. --out writes a file; existing files are not replaced unless you also pass --overwrite.

Exit codes: 0 success, 1 invalid JSON / failed repair / schema or compare inequality, 2 usage or missing file / refused overwrite.

Error handling

Typed errors: InvalidJsonError, InvalidInputTypeError, InvalidPathError, InvalidSchemaError, UnsupportedRepairError, MaxDepthExceededError, TransformationConflictError, FileOperationError.

Security

  • No eval, no Function, no execution of JSON as code
  • No network calls in the library
  • Own-property assignment for __proto__, constructor, and prototype
  • Depth limits on recursive walks
  • CLI refuses to overwrite files by default

Limitations

  • JSONPath is a subset, not RFC 9535 / full JSONPath
  • Schema support is draft-07 as implemented by Ajv 8
  • Array comparison is index-based unless ignoreArrayOrder is enabled
  • Repair refuses anything that is not a listed deterministic transform
  • ignoreArrayOrder uses greedy deep-equality matching, not a minimum-edit assignment

Testing

npm test
node examples/complete-demo.js
npx jsondoctor validate tests/fixtures/valid.json

License

MIT. See LICENSE and CONTRIBUTING.md.

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • npm jsondoctor

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

CVE

Java4Shell (CVE-2026-114938): Easy to Crash, Hard to Exploit — Less Than 0.12% of JVMs Estimated at Risk of RCE

Ethersphere Hijacked With Crypto Stealing Malware (1)
npm

Ethersphere Hijacked With Crypto Stealing Malware Via Github & npm

Critical Apache HTTP Server Flaw Exposes Web Servers to RCE (1)
CVE

CVE-2026-119618: Critical Apache HTTP Server Flaw Exposes Web Servers to Remote Code Execution

Frame 2085668439 (1)
Group 1261154229