Registry / testing / durable-json-lint

durable-json-lint

JSON →
library0.0.3jsnpmunverified

A Json Lint library (v0.0.3, last updated in 2012) that parses and partially corrects dirty JSON without crashing. It can fix common errors like single quotes, hex numbers, and function calls, and returns corrected JSON alongside error details. Unlike most JSON linters, it continues parsing after errors and substitutes invalid constructs with null. Written in CoffeeScript, runs on Node >=0.4.0 and browsers. Low release cadence and minimal maintenance since 2013.

npm install durable-json-lint
INSTALL
IMPORT
SIG · DURABLE-JSON-LINT
D
durable-json-lint
testingjavascriptv0.0.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import durableJsonLint from 'durable-json-lint'
const durableJsonLint = require('durable-json-lint')
Package does not specify ESM; CommonJS require works, but ESM import is more modern.
default
const durableJsonLint = require('durable-json-lint')
import { durableJsonLint } from 'durable-json-lint'
Only default export; named import will fail.
TypeScript types
import durableJsonLint from 'durable-json-lint' // then declare type manually
No type definitions exist
Package has no TypeScript types; use @types/durable-json-lint or define own.

Demonstrates linting dirty JSON with single quotes, function call, hex number and viewing corrected output and errors.

import durableJsonLint from 'durable-json-lint'; const result = durableJsonLint(`{name:"value", 'array':[call(), 0x11]}`); console.log('Corrected JSON:', result.json); console.log('Errors:', JSON.stringify(result.errors, null, 2));
Debug
Known issues
deprecatedPackage is largely unmaintained since 2013; may not work with modern Node versions beyond 0.4.x.
fix
Consider using a maintained JSON linter like jsonlint or ajv.
affects: >=0.0.3
gotchaError status 'crash' indicates parser completely failed; no JSON returned.
fix
Wrap call in try-catch to handle crashes; check result.json for null.
affects: >=0.0.1
gotchaThe library substitutes invalid constructs with null without warning in corrected output.
fix
Always inspect errors array to understand substitutions.
affects: >=0.0.1
breakingPackage uses CoffeeScript; Node.js may require a CoffeeScript runtime to require if compiled .js missing.
fix
Use npm 1.x or precompile; on modern Node, install coffee-script globally or use an alternative.
affects: >=0.0.1
gotchaError descriptions may be humorous or sarcastic, not suitable for production error messages.
fix
Do not present user-facing errors directly.
affects: >=0.0.1
Errors
Common errors & fixes
Error: Cannot find module 'coffee-script'
Package's require may attempt to load CoffeeScript at runtime.
fix
Install coffee-script: npm install coffee-script
TypeError: durableJsonLint is not a function
Incorrect import: using named import instead of default.
fix
Use import durableJsonLint from 'durable-json-lint' or const durableJsonLint = require('durable-json-lint')
Uncaught ReferenceError: require is not defined
Using CommonJS require in ESM environment without bundler.
fix
Use import syntax or a bundler like webpack.
Upgrade
Version history
0.0.3latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
durable-json-lint — npm install durable-json-lint · libregistry