Skip to content

Latest commit

 

History

History
54 lines (35 loc) · 1.07 KB

README.md

File metadata and controls

54 lines (35 loc) · 1.07 KB

Test

Install

npm

npm install @wasm-fmt/lua_fmt

jsr.io

npx jsr add @fmt/lua-fmt

Usage

import init, { format } from "@wasm-fmt/lua_fmt";

await init();

const input = `print "Hello World"`;

const formatted = format(input, "main.lua");
console.log(formatted);

For Vite users:

Add "@wasm-fmt/lua_fmt" to optimizeDeps.exclude in your vite config:

{
    "optimizeDeps": {
        "exclude": ["@wasm-fmt/lua_fmt"]
    }
}

Or use another import entry:

import init, { format } from "@wasm-fmt/lua_fmt/vite";

// ...

Credits

Thanks to: