@wasm-fmt/malva_fmt
v0.1.17
Published
Style/CSS/SASS/LESS formatter powered by WASM ported from malva
Maintainers
Readme
malva_fmt
CSS/SCSS/SASS/LESS formatter powered by WASM ported from malva.
Usage
Node.js
import init from "malva_fmt";
const { format } = await init();
const result = format(
".foo {\n color: red;\n}",
"style.css",
{
indentStyle: "space",
indentWidth: 2,
lineWidth: 80,
lineEnding: "lf",
}
);Vite
Add "@wasm-fmt/malva-fmt" to optimizeDeps.exclude in your vite config:
{
"optimizeDeps": {
"exclude": ["@wasm-fmt/malva-fmt"]
}
}import init from "@wasm-fmt/malva-fmt/vite";
const { format } = await init();
const result = format(
".foo {\n color: red;\n}",
"style.css",
{
indentStyle: "space",
indentWidth: 2,
lineWidth: 80,
lineEnding: "lf",
}
);Configuration
See malva configuration docs for all available options.
