Utilities
Format JavaScript or TypeScript with Oxfmt
oxfmt-format is a single-file JavaScript and TypeScript formatting node powered by Oxfmt.
overview
What oxfmt-format does
Format one JavaScript, JSX, TypeScript or TSX file on stdin with Oxfmt. Choose the parser with language; js is the default. Fixed settings use two spaces, semicolons, double quotes, width 80 and LF line endings, with embedded-language formatting disabled.
The wrapper ignores nested project configuration and uses a synthetic stdin filename for the chosen parser, so a supplied output.txt works. Input is limited to 5 MiB and formatting to 60 seconds; the Node heap is 512 MiB and output limit is 20 MiB. Empty source is valid.
Input or native processing failures fail the operation. The operation keeps the supplied source unchanged.
This operation uses 0.71.0. Upstream license: MIT. The source link identifies the program used by this node.
source github.com/oxc-project/oxc/tree/oxfmt_v0.71.0/npm/oxfmt
use cases
Where oxfmt-format fits
Format a JavaScript snippet
Format one JS file with the bundled fixed settings.
Select a TypeScript parser
Set language to ts or tsx for TypeScript syntax.
Use consistent source formatting
Return a formatted copy without executing source or discovering package scripts.
reference
oxfmt-format inputs and flags
| Name | Type | Flag | Description |
|---|---|---|---|
| input | FILE | --input | UTF-8 source file up to 5 MiB. Filename extension does not matter. Fixed config uses two spaces, semicolons, double quotes, width 80 and LF line endings. |
| language | STRING | --language | Parser language; one of js, jsx, ts or tsx. Defaults to js. Formatting times out after 60 seconds. |
Showing key inputs. oxfmt-format exposes 2 inputs in total.
example
Run oxfmt-format
/app/run.sh --input ./input.txt --language js ./outputconst answer = { value: 42, label: "hello" };
function add(a, b) {
return a + b;
}guidance
Choosing oxfmt-format
Choose Oxfmt for a formatted source file. Formatting does not transpile or type-check TypeScript, and it does not run the program or load repository scripts.
black-format
Formats Python; Oxfmt handles JS, JSX, TS and TSX.
faq
oxfmt-format questions
related
More Utilities tools
browser-fetch
Headless Chromium render: requested URL, final URL, status, and title next to the page.
cewl
Spider a URL and return a wordlist for password crackers.
csvkit
SQL on one CSV. The table name is the file stem.
dnsgen
Wordlist and mined-word subdomain permutation.
duckdb
In-process SQL on CSV, JSON, and Parquet. No server.
edge-tts
Microsoft Edge neural speech from text or a script file. No API key.
Run oxfmt-format yourself
The synthetic run checks formatted source. The excerpt shows exact text asserted by saved passing platform verifier; recovered from fixture assertion, not a newly downloaded artifact. The command shown is the container entrypoint with example paths, not a host-installed CLI command.
Facts on this page come from the live Trickest tool library.