A standalone CLI tool for formatting Motoko source files, built on Prettier (v2.7) and the prettier-plugin-motoko plugin. Current stable version is 0.13.0, released by DFINITY. It offers a simple command-line interface for formatting .mo files in-place or checking format compliance. The tool can be installed globally via npm or used via npx; portable executables are also available for environments without Node.js. Compared to using the underlying Prettier plugin directly, mo-fmt provides a streamlined, zero-configuration experience for Motoko developers.
npm install mo-fmtNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows global installation and basic usage: formatting .mo files and checking format compliance.
Use quotes around glob patterns: mo-fmt "**/*.mo"
Ensure prettier@^2.7 is installed alongside mo-fmt.
Use child_process.spawn or exec to invoke mo-fmt from Node.js scripts.
Run 'npm install prettier@^2.7' in the same project.
Install globally with 'npm install -g mo-fmt' or use 'npx mo-fmt'.