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.

npm install format-json-cli
INSTALL
IMPORT
SIG · FORMAT-JSON-CLI
F
format-json-cli
serializationjavascriptv1.1.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
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.

default
npx format-json-cli
CLI tool; no JavaScript import. Run via npx or global install.
CLI
format-json-cli
format-json
The command is 'format-json-cli', not 'format-json' or 'format-json-cli' with hyphens omitted.

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 issues
gotchaThe tool outputs formatted JSON to stdout by default; does NOT modify the file in-place without shell redirection.
fix
Use shell redirection: `format-json-cli input.json > output.json` or `mv` trick.
affects: *
Errors
Common errors & fixes
command not found: format-json-cli
Package not installed globally or locally.
fix
Run `npm install -g format-json-cli` or `npx format-json-cli` for one-off use.
Cannot find module '...'
Using the package as a Node.js module dependency via require/import incorrectly.
fix
This is a CLI tool, not a library. Use the command line interface.
Upgrade
Version history
1.1.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
8
Resources
format-json-cli — npm install format-json-cli · libregistry