A command-line interface for Prettier, an opinionated code formatter. This package is currently a work-in-progress (WIP) and provides a CLI wrapper around Prettier's API. Prettier itself is at version 3.8.3 (January 2026), with a monthly release cadence. Unlike the standalone `prettier` package, this package aims to offer additional CLI features such as progress bars, better error handling, and configuration validation. It is intended for users who want an enhanced CLI experience while leveraging Prettier's formatting capabilities.
npm install prettier-cliVerified import paths — ran on the pinned version, not inferred.
Demonstrates basic usage of Prettier's format function to format a JavaScript file.
Switch to ESM imports or use dynamic import().
Use `prettier --write file.js` instead of `prettier --write .` without arguments.
Always review diffs before committing.
Run Prettier before ESLint to avoid conflicts.
Use ESM imports (import ... from 'prettier') or use dynamic import() in CommonJS.
Use the correct parser (e.g., 'babel' for JSX) and ensure Prettier is up-to-date.
Run `npm install prettier` to install the package.