# josdejong/jsonrepair

Repair invalid JSON documents

Repository: https://github.com/josdejong/jsonrepair
Canonical: https://ross.abutalabs.com/products/jsonrepair
Homepage: https://josdejong.github.io/jsonrepair/
Language: TypeScript
License: NOASSERTION
License Family: other
Topics: json, repair
Last push: 2026-07-03T17:43:52+00:00

## Health v2 (maintenance only)
Score: 73/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 90, release rhythm 35, longevity 100
- inputs: {"age_days": 2130, "days_push": 61, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases, no_license
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2397, forks 88 (observed 2026-08-28T04:06:43.659994+00:00)

## What it is
A TypeScript library that repairs invalid JSON documents, fixing issues like missing quotes, commas, brackets, single quotes, comments, trailing commas, JSONP, MongoDB types, and newline-delimited JSON. It offers both a simple function API and a streaming API for handling arbitrarily large documents.

## Use cases
- repair broken json from llm output
- fix invalid json copied from javascript code
- convert ndjson to a json array
- strip comments and trailing commas from json
- repair truncated json files
- clean up jsonp or mongodb-flavored json

## When to choose
- you receive malformed JSON from LLMs, APIs, or copy-pasted sources and need it parsed
- you need to stream-repair very large JSON documents
- you want a lightweight npm library usable in ESM, CommonJS, or UMD projects

## When to avoid
- you need strict JSON validation rather than lenient repair
- you need a parser for formats other than JSON
- your project is not in a JavaScript/TypeScript runtime

## Facets
- artifact type: library
- maturity: active
- function: parser, serialization, json, developer-tools
- domain: developer-tools, parsers, files, large-language-models
- platform: cross-platform
- tags: json-repair, llm-output-fixing, streaming, typescript, nodejs, javascript

## Member repositories
- josdejong/jsonrepair (main) score 73

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:43.659994+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:34:20.213272+00:00, confidence not recorded.
  - readme: https://github.com/josdejong/jsonrepair (fetched 2026-08-28T04:06:43.659994+00:00, sha 79a0ea71e041)
  - homepage: https://josdejong.github.io/jsonrepair/ (fetched 2026-08-29T10:15:07.454776+00:00, sha 95fb43ead4eb)
  - registry_npm: https://registry.npmjs.org/jsonrepair (fetched 2026-08-29T10:15:07.457201+00:00, sha d0a4ad3952df)
- Data as of 2026-08-30T08:39:29.467469+00:00.
