Registry / devops / prettier-oxc-parser

prettier-oxc-parser

JSON →
library0.2.0jsnpmunverified

Use oxc as a Prettier parser for faster JavaScript and TypeScript formatting. Current stable version 0.2.0 (April 2025) requires Prettier >= 3.6.2. Releases are based on oxc-parser major updates. Differentiators: faster than default Prettier parsers for large TS projects, supports raw transfer on Node >= 22 for near-zero AST copy cost, and handles decorators in JS files since v0.2.0. Alternative to @prettier/plugin-oxc with better performance due to synchronous API and raw transfer.

npm install prettier-oxc-parser
INSTALL
IMPORT
SIG · PRETTIER-OXC-PARSE
P
prettier-oxc-parser
devopsjavascriptv0.2.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

plugin
// Add to Prettier config: "plugins": ["prettier-oxc-parser"]
import or require of the package directly
No JavaScript import needed. The package is a Prettier plugin, loaded via config file.
prettier
import { format } from 'prettier'
import { format } from 'prettier-oxc-parser'
Use Prettier's own API; the plugin is registered in config.
node:path
const path = require('node:path')
const path = require('path')
Use node: prefix for built-in modules in Node >= 16.

Install the plugin, add to Prettier config, then format files using Prettier CLI or API with the plugin loaded.

// .prettierrc.json { "plugins": ["prettier-oxc-parser"] } // Then format files with Prettier CLI or API: // npx prettier --write "src/**/*.{js,ts,jsx,tsx}" // Or programmatically: import { format } from 'prettier'; const code = 'const x: string = "hello";'; const formatted = await format(code, { parser: 'typescript', plugins: ['prettier-oxc-parser'] }); console.log(formatted);
Debug
Known issues
breakingRequires Prettier >= 3.6.2
fix
Upgrade Prettier to 3.6.2 or higher.
affects: <0.1.0
gotchaRaw transfer for AST performance only works on Node >= 22
fix
Use Node 22+ for maximum speed, or fall back to normal transfer.
affects: >=0.1.0
gotchaFlow annotations in .js files via @flow pragma are not supported
fix
Do not use with Flow-typed files; stick to default Prettier parser for those.
affects: >=0.1.0
deprecatedoxc-parser version 0.72.0 had issue with `declare module a.b` and `declare namespace a.b`
fix
Upgrade to 0.2.0 which bumps oxc-parser to 0.77.2.
affects: 0.1.1
Errors
Common errors & fixes
Error: Cannot find module 'prettier-oxc-parser'
Plugin not installed or not in node_modules
fix
Run npm install -D prettier-oxc-parser
Error: [prettier-oxc-parser] This plugin requires Prettier >= 3.6.2
Installed Prettier version is too old
fix
npm install -D prettier@latest
TypeError: prettier.format is not a function
Using CommonJS require with default export; Prettier >= 3 uses ESM
fix
Use import { format } from 'prettier' or dynamic import().
Upgrade
Version history
0.2.0latest on npm
Audit
Dependencies
prettierrequiredPeer dependency; plugin requires Prettier >= 3.6.2
Agent activity
4 hits · last 30 days
node
4
Resources
prettier-oxc-parser — npm install prettier-oxc-parser · libregistry