Registry / testing / jsonlint-tree

jsonlint-tree

JSON →
library2.0.1jsnpmunverified

A recursive directory JSON validator using jsonlint. Version 2.0.1 requires Node >=18.17, removes extra dependencies from v1, and outputs a summary of valid/invalid files. It differs from other JSON linters by operating recursively on directories rather than single files, providing a clear CLI output with counts. Maintained by educastellano.

npm install jsonlint-tree
INSTALL
IMPORT
SIG · JSONLINT-TREE
J
jsonlint-tree
testingjavascriptv2.0.1
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.

jsonlint-tree
npx jsonlint-tree <directory>
npm run jsonlint-tree
CLI tool; runs directly via npx or global install. No programmatic API.
require
const jsonlint = require('jsonlint')
const lint = require('jsonlint-tree')
Package is CLI-only; you cannot import it programmatically.
import
import jsonlint from 'jsonlint';
import tree from 'jsonlint-tree';
No default export; use jsonlint directly for file validation.

Shows how to run jsonlint-tree on a directory, outputting valid/invalid file counts.

npx jsonlint-tree ./examples
jsonlint --version
Debug
Known issues
breakingNode version requirement changed to >=18.17 in version 2.0.0
fix
Upgrade Node.js to >=18.17 or use version 1.x for older Node.
affects: >=2.0.0
deprecatedVersion 1.x is deprecated; upgrade to 2.x for reduced dependencies and modern Node support.
fix
Update to version 2.0.1 with npm install jsonlint-tree@latest
affects: <2.0.0
gotchajsonlint-tree is a CLI tool only; it cannot be imported programmatically. Some users attempt to require('jsonlint-tree') and get undefined.
fix
Use child_process.spawn or exec to run the CLI from within Node scripts.
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'jsonlint-tree'
Attempting to require or import the package programmatically.
fix
Install globally or use npx; do not import it in code.
Error: jsonlint-tree requires at least one argument
Running the command without specifying a directory.
fix
Run: npx jsonlint-tree <directory-path>
ENOENT: no such file or directory, scandir './nonexistent'
Specified directory does not exist.
fix
Provide a valid directory path.
Upgrade
Version history
2.0.1latest on npm
Audit
Dependencies
jsonlintrequiredUsed for parsing and validating JSON files
Agent activity
2 hits · last 30 days
node
2
Resources
jsonlint-tree — npm install jsonlint-tree · libregistry