fmtjs is a JavaScript code formatter for Node.js and the browser, currently at version 5.9.0. It provides opinionated formatting with a focus on speed and minimal configuration, supporting ES modules and CommonJS. The library uses a stable parse-and-print approach with built-in style presets and plugin support for custom rules. Release cadence is monthly with active maintenance. Compared to Prettier, fmtjs offers lighter bundle size and faster formatting for large files, but lacks ecosystem plugins.
npm install fmtjsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates importing the format function and formatting a simple code snippet with a style option.
Replace require('fmtjs') with dynamic import or migrate to named imports: import { format } from 'fmtjs'.Define precise options like { trailingComma: 'es5' } to avoid inconsistencies.Replace with repeated calls to 'format' with file filter logic.
Use fs.createReadStream and pipe through a transform that calls format on chunks.
Change 'import format from 'fmtjs'' to 'import { format } from 'fmtjs''Run 'npm install fmtjs' and ensure the package is listed in dependencies.
Either use dynamic import: 'const { format } = await import('fmtjs')' or transpile with Babel/TypeScript.No dependency data recorded yet.