A pure JavaScript/TypeScript formatter for HAML templates that automatically indents and structures HAML code. Version 0.1.0, released in 2019, with no recent updates. It offers a single function FormatHaml with options for tab size and spaces vs tabs. Lightweight and simple, it differs from Ruby-based formatters by being usable in Node.js without Ruby dependencies. Suitable for linting and formatting HAML files in build pipelines or editors.
npm install haml-formatterNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates formatting HAML with custom options (tab size and spaces).
Use import syntax or set "type":"module" in package.json, or use dynamic import() in CJS.
Validate HAML before formatting, e.g., with haml-js.
Write a script to read files and pipe through FormatHaml, or use a task runner.
Add "type": "module" to package.json or convert file to .mjs extension.
Use import { FormatHaml } from 'haml-formatter' or const FormatHaml = (await import('haml-formatter')).FormatHaml.Add import type { Options } from 'haml-formatter' or use inline type.No dependency data recorded yet.