Registry / devops / fua-fua

fua-fua

JSON →
library0.1.6jsnpmunverified

A blazing-fast, highly-permissive HTML formatter with optional WASM plugins, focused on Angular templates and plain HTML. Current stable version is 0.1.6, released as minimal-viable. It uses native binaries per OS (no Node-based formatter) and ships a small Node launcher. Key differentiators: performance via native code and WASM plugins for Angular and Tailwind CSS; built-in batch modes (--only-staged, --all, --changed, --check) and include/exclude via config; no custom wrapper scripts needed. Alternative to prettier or beautify-html with Angular-specific awareness.

npm install fua-fua
INSTALL
IMPORT
SIG · FUA-FUA
F
fua-fua
devopsjavascriptv0.1.6
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

CLI
npx fua-fua --only-staged --config .fua/config.json
npx fua-fua --staged --config .fua/config.json
CLI is invoked via npx; there is no programmatic API. Use --only-staged for staged files, not --staged.
config
import type { FuaConfig } from 'fua-fua';
import { FuaConfig } from 'fua-fua';
TypeScript type import only; runtime config is JSON file, not JS.
prepare script
"prepare": "husky"
"prepare": "husky install"
Husky v9 uses 'husky' instead of 'husky install'. Ensure latest version.

Initialize project, install dependencies, create config, and format a single HTML file.

npm init -y npm i -D fua-fua @fua-fua/plugin-angular @fua-fua/plugin-tailwind husky echo '{ "indent_size": 2, "use_tabs": false, "print_width": 100, "wrap_attributes": true, "include": ["src/**/*.html"], "exclude": ["node_modules/", "dist/"], "plugins": [ { "path": "./node_modules/@fua-fua/plugin-tailwind/dist/fua_plugin_tailwind.wasm", "options": { "class_wrap_tokens_per_line": 2 } }, { "path": "./node_modules/@fua-fua/plugin-angular/dist/fua_plugin_angular.wasm", "options": { "wrap_conditions_min": 2 } } ] }' > .fua/config.json npx fua-fua --input src/app/app.component.html --output src/app/app.component.html --config .fua/config.json
Debug
Known issues
gotchaThe CLI requires a native binary for your OS; if missing, installation may fail silently or run a fallback.
fix
Ensure you are on a supported OS (Linux, macOS, Windows) and have Node.js 16+.
affects: >=0.0.0
gotchaUse --only-staged, not --staged, for staged file formatting.
fix
Replace --staged with --only-staged in scripts and hooks.
affects: >=0.1.0
deprecatedHusky v8 and earlier used 'husky install'. The package now recommends 'husky' for v9.
fix
Use 'husky' instead of 'husky install' in the prepare script.
affects: >=0.1.0
gotchainclude/exclude patterns: exclude is regex if valid, else substring; include is glob. Misuse can skip unintended files.
fix
Use full glob paths for include (e.g., src/**/*.html) and regex or substrings for exclude.
affects: >=0.1.0
gotchaPlugin paths must be absolute or relative to project root; relative paths may break if running from subdirectory.
fix
Use absolute paths or paths starting with ./node_modules/.
affects: >=0.1.0
breakingBreaking change in WASM plugin API for v0.2.0? Not yet released, but config options may change.
fix
Check changelog before upgrading minor version.
affects: >=0.2.0
Errors
Common errors & fixes
Error: ENOENT: no such file or directory, open '/path/to/.fua/config.json'
Config file missing or path incorrect.
fix
Create .fua/config.json at project root and verify the --config path.
Error: Plugin not found: ./node_modules/@fua-fua/plugin-tailwind/dist/fua_plugin_tailwind.wasm
Plugin WASM file missing or path incorrect.
fix
Install @fua-fua/plugin-tailwind and ensure the path matches the actual installed location.
husky - warning: .husky/pre-commit hook script is not executable
Pre-commit hook file lacks execute permission.
fix
Run chmod +x .husky/pre-commit
Git failed with exit code 128
No git repository or detached HEAD.
fix
Run git init and make an initial commit before using --only-staged.
Upgrade
Version history
0.1.6latest on npm
Audit
Dependencies
@fua-fua/plugin-angularoptionalOptional WASM plugin for Angular template-specific formatting (conditions, ngClass).
@fua-fua/plugin-tailwindoptionalOptional WASM plugin for Tailwind CSS class ordering and grouping.
huskyoptionalCommonly used together for pre-commit hook integration.
Agent activity
2 hits · last 30 days
node
2
Resources
fua-fua — npm install fua-fua · libregistry