Registry / serialization / format-json-cli

format-json-cli

JSON →
library1.1.0jsnpmunverified

A CLI tool to format JSON files, designed as a post-hook to fix Prettier's JSON output. Version 1.1.0 is the latest stable release. It provides a simple command-line interface for formatting JSON files either globally or locally via npm scripts. Differentiators: lightweight, zero dependencies, focused solely on JSON formatting without opinionated defaults.

serializationdevops
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

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

CLI tool; no JavaScript import. Run via npx or global install.

npx format-json-cli

The command is 'format-json-cli', not 'format-json' or 'format-json-cli' with hyphens omitted.

format-json-cli

Installs the CLI globally, creates a sample JSON file, and formats it, showing stdout output and in-place modification pattern.

npm install -g format-json-cli echo '{"name":"test"}' > file.json format-json-cli file.json # outputs formatted JSON to stdout # To modify file in-place (requires redirection) format-json-cli file.json > file.json.new && mv file.json.new file.json
format-json --version
Debug
Known footguns
gotchaThe tool outputs formatted JSON to stdout by default; does NOT modify the file in-place without shell redirection.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
16 hits · last 30 days
gptbot
4
ahrefsbot
4
amazonbot
3
script
1
Resources