pike-fmt is a standalone source code formatter for the Pike programming language, built on tree-sitter-pike for AST-aware formatting. Current stable version is 0.1.6, released with monthly cadence. It normalizes indentation (2-space), whitespace, and optionally operator spacing. Key differentiators: first dedicated Pike formatter, uses Tree-sitter for accurate parsing, and supports CLI flags for check/diff/list/write modes.
npm install pike-fmtNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates programmatic usage with formatString and format functions, plus CLI invocation.
Use import syntax or enable ESM in package.json with 'type': 'module'.
Use format() with file content read via fs.readFileSync/fs.promises.
Check future releases for stabilization; use cautiously.
No customization; if different style needed, file an issue or fork.
Ensure input is valid Pike; errors are not handled gracefully.
npm install pike-fmt or bun install pike-fmt
Change to import or set 'type': 'module' in package.json.
Use import { formatString } from 'pike-fmt'