@wasm-fmt/yamlfmt
v0.0.2
Published
A WASM Based YAML Formatter
Downloads
295
Readme
Install
npm install @wasm-fmt/yamlfmt
npx jsr add @fmt/yamlfmt
Usage
import init, { format } from "@wasm-fmt/yamlfmt";
await init();
const input = "- a\n- b\n";
const formatted = format(input, "sample.yaml");
console.log(formatted);
For Vite users:
Add "@wasm-fmt/yamlfmt"
to optimizeDeps.exclude
in your vite config:
{
"optimizeDeps": {
"exclude": ["@wasm-fmt/yamlfmt"]
}
}
import init, { format } from "@wasm-fmt/yamlfmt/vite";
// ...
Credits
Thanks to: