Command-line tool
prettier
brew/prettier
Checked 25 Oct 2026, 21:11 UTC · Still published on npm
Code formatter for JavaScript, CSS, JSON, GraphQL, Markdown, YAML
At a glance
- Type
- Command-line tool
- Install on
- Windows, macOS, Linux
- Last checked
- 25 Oct 2026, 21:11 UTC
Install it
Windows
npm install -g prettier
macOS
brew install prettier npm install -g prettier
Linux
npm install -g prettier
Format a file and print the result to `stdout`
prettier path/to/file
Check if a specific file has been formatted
prettier --check path/to/file
Run with a specific configuration file
prettier --config path/to/config_file path/to/file
Browse
Related command-line tools
- libxo
Allows an application to generate text, XML, JSON, and HTML output - sane-fmt
Opinionated code formatter for TypeScript and JavaScript - xo
JavaScript/TypeScript linter (ESLint wrapper) with great defaults cli-app cli xoxo happy happiness code quality style… - yamlfix
Simple and configurable YAML formatter that keeps comments - rome
Rome is a toolchain for the web: formatter, linter and more javascript typescript format lint toolchain json - markdown-toc-gen
Generating and updating table of contents in Markdown files which conform with prettier. toc markdown generator table… - ferrite
A fast, lightweight text editor for Markdown, JSON, YAML, and TOML files. - auto-doc
Generate a beautiful, easy-to-read markdown table or YAML code block with just a few lines of code.
Listing text is written by the maker; AptLynx lists tools and does not vouch for them. Find another tool · Browse by topic · For agents