{"id":20043,"library":"format-json-cli","title":"format-json-cli","description":"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.","status":"active","version":"1.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/beenotung/format-json-cli","tags":["javascript","format","prettier","cli"],"install":[{"cmd":"npm install format-json-cli","lang":"bash","label":"npm"},{"cmd":"yarn add format-json-cli","lang":"bash","label":"yarn"},{"cmd":"pnpm add format-json-cli","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"CLI tool; no JavaScript import. Run via npx or global install.","wrong":"","symbol":"default","correct":"npx format-json-cli"},{"note":"The command is 'format-json-cli', not 'format-json' or 'format-json-cli' with hyphens omitted.","wrong":"format-json","symbol":"CLI","correct":"format-json-cli"}],"quickstart":{"code":"npm install -g format-json-cli\necho '{\"name\":\"test\"}' > file.json\nformat-json-cli file.json # outputs formatted JSON to stdout\n# To modify file in-place (requires redirection)\nformat-json-cli file.json > file.json.new && mv file.json.new file.json","lang":"javascript","description":"Installs the CLI globally, creates a sample JSON file, and formats it, showing stdout output and in-place modification pattern."},"warnings":[{"fix":"Use shell redirection: `format-json-cli input.json > output.json` or `mv` trick.","message":"The tool outputs formatted JSON to stdout by default; does NOT modify the file in-place without shell redirection.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run `npm install -g format-json-cli` or `npx format-json-cli` for one-off use.","cause":"Package not installed globally or locally.","error":"command not found: format-json-cli"},{"fix":"This is a CLI tool, not a library. Use the command line interface.","cause":"Using the package as a Node.js module dependency via require/import incorrectly.","error":"Cannot find module '...'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}