Use this file to discover Exa products, pricing, evaluations, comparisons, use cases, agent interfaces, and technical documentation before exploring further.
JavaScript code formatters rewrite source files in one consistent style for indentation, line breaks, quotes, and semicolons. These libraries run in editors, pre-commit hooks, and CI to keep code written by developers and coding agents in one style.
Popularity
Prettier has the most installs and the most GitHub stars.
Prettier parses source code and reprints it from scratch in one consistent style, discarding the original formatting. When a line exceeds the print width, Prettier breaks it up, putting each argument of a long function call on its own line. Supported languages include JavaScript, TypeScript, JSX, CSS, HTML, JSON, GraphQL, Markdown, and YAML. From JavaScript, prettier.format takes the source text and an options object. Its parser option sets the language, or filepath lets Prettier infer the language from the file extension. A second function, prettier.check, reports whether a file is formatted, the same check the --check flag runs in CI.
Downloads / mo
714.1M
Stars
52.4K
Last release
3.10.1
License
MIT
Strengths
Reads project settings.Finds the config file for each source file before formatting it.
Picks the parser from the file name.Pass a file path, and Prettier chooses the language parser.
Limitations
Async API.Every API call returns a promise. Synchronous use needs the separate @prettier/sync package.
Few style options.Prettier describes itself as opinionated. Most layout choices are fixed rather than configurable.
Oxfmt is a formatter for JavaScript, TypeScript, and other web languages, built on the Oxc compiler stack. Its output starts from what Prettier prints. A project migrating from a recent Prettier version sees few formatting differences. The Oxfmt team treats any unexpected difference as a bug. Import sorting, Tailwind CSS class sorting, and package.json field sorting come built in, where Prettier needs plugins. The oxfmt command formats files in place. With --check, the command lists unformatted files and leaves their contents unchanged.
Downloads / mo
109.3M
Stars
23.5K
Last release
0.79.0
License
MIT
Strengths
Sorting built in.Sorts imports, Tailwind CSS classes, and package.json fields without plugins.
Takes source text directly.Call format() with a file name, the source text, and options.
Limitations
No Prettier plugins.Prettier plugins don't load. Oxfmt builds in the most popular ones instead.
Different defaults.The default print width is a hundred characters, compared with eighty in Prettier. A prettier field in package.json isn't read.
Biome is a toolchain that formats and lints JavaScript, TypeScript, JSX, JSON, CSS, GraphQL, HTML, and other web languages in one program. The formatter matches Prettier on about ninety-seven percent of cases. A linter with more than seven hundred and fifty rules, drawn from ESLint, typescript-eslint, and other sources, ships in the same binary. On the command line, biome format --write formats files, while biome check --write runs formatting, linting, and safe fixes together. Biome runs without Node.js.
Downloads / mo
102.3M
Stars
26.1K
Last release
2.6.8
License
MIT OR Apache-2.0
Strengths
Formats and lints together.One command runs the formatter, the linter, and import organizing.
Same settings in editor and CLI.One biome.json applies to both the command line and the editor.
Limitations
Prettier differences.Output differs from Prettier on a small share of cases. Switching formatters produces some diffs to review.
const formatFileWithBiome = (filePath: string) => {
// Normalize to forward slashes for cross-platform Biome compatibility const normalizedPath = filePath.replace(/\\/g, "/");
const { status } = spawnSync(
"yarn",
["biome", "format", "--write", "--no-errors-on-unmatched", normalizedPath],
{
stdio: "inherit",
cwd: repoRoot,
shell: true,
}
);
if (status !== 0) {
throw new Error(`Biome formatting failed for ${filePath}`);
}
};
JS Beautifier
JS Beautifier reformats and re-indents JavaScript. The same tool unpacks packed scripts and partly deobfuscates obfuscated code. The npm package, js-beautify, installs a command-line program and three library functions: js_beautify, css_beautify, and html_beautify. Each function takes a string of code and an options object, such as indent_size for the indent width. A Python port, jsbeautifier, formats JavaScript only.
Downloads / mo
64.0M
Stars
9.0K
Last release
2.0.3
License
MIT
Strengths
One function per language.Call the JavaScript, CSS, or HTML beautifier on a string of code.
Fine-grained spacing options.Set indent size and spacing options on each call.
Limitations
Fewer HTML options.The CSS and HTML beautifiers are simpler in scope and have far fewer options than the JavaScript one.
Few maintainers.The README asks for contributors because the current owners have very limited time for the project.
const beautifyDocRanges = (doc, ranges, type, formattingOptions, isPartial) => {
if (!doc) {
vscode.window.showInformationMessage(
'Beautify can\'t get the file information because the editor won\'t supply it. (File probably too large)');
throw '';
}
return Promise.resolve(type ? type : getBeautifyType())
.then(type => options(doc, type, formattingOptions)
.then(config => removeNewLineEndForPartial(config, isPartial))
.then(config => Promise.all(ranges.map(range =>
beautify[type](doc.getText(range), config)))));
};
dprint
dprint is a command-line formatter that runs the language plugins a project lists in a dprint.json file. dprint init creates that file and preselects plugins that match the files in the directory. After setup, dprint fmt formats the project. A second command, dprint check, lists unformatted files. Plugins cover TypeScript, JSON, Markdown, TOML, Dockerfiles, and SQL. Wrapper plugins run other formatters, such as Prettier, Biome, and Oxc, behind the same command.
Downloads / mo
1.8M
Stars
4.1K
Last release
0.65.0
License
MIT
Strengths
Wraps other formatters.Plugins run Prettier, Biome, or Oxc behind the same dprint command.
Limitations
Config file first.Formatting reads the plugin list from dprint.json. A new project runs dprint init before the first dprint fmt.
One plugin per language.A language is formatted only after its plugin is added to the config.
Use Prettier by default. It has the most downloads by far, at 714.1M a month. Choose Biome to replace Prettier and ESLint with one tool, or Oxfmt for Prettier-style output that runs much faster.
Yes, for most projects. Prettier formats code, and ESLint catches bugs. Turn off the ESLint style rules that conflict with Prettier so the two tools don't fight.
Biome formats and lints in one pass, and biome migrate prettier copies existing Prettier settings into Biome. Its defaults differ from Prettier's, so review the output after switching. Stay on Prettier for projects that rely on its plugins.
Yes, in most projects. Oxfmt uses Prettier's output as its baseline, so projects on a recent Prettier version see few differences. Oxfmt doesn't load Prettier plugins, but it builds in import sorting and Tailwind CSS class sorting.
Run prettier . --check. The command fails when any file isn't formatted, without changing the files.
For coding agents
Found your code formatter library? Help your agent use it.
Connect Exa so your coding agent can find the library’s documentation, check its API, and look up implementations while you build.