wat-compiler is a zero-dependency JavaScript library that compiles WebAssembly Text Format (WAT) source code into binary WebAssembly modules (Uint8Array). It provides a simple functional API with optional performance metrics. v1.1.1 is the latest stable version; the library is lightweight, has no external runtime dependencies, and ships TypeScript definitions. Unlike full WAT toolchains (wabt, wast2wasm), it is designed for in-browser or Node.js use with minimal overhead.
npm install wat-compilerNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates compiling a simple WAT module to binary, then instantiating WebAssembly.
Ensure WAT syntax is valid. Use a tool like `wat2wasm` for debugging.
Use `import compile from 'wat-compiler'` instead of `import { make } from 'wat-compiler'`.For performance measurement, use external tools like `console.time` instead.
Switch to ESM import syntax. The package is ESM-only.
Use `import compile from 'wat-compiler'` in an ESM context, or use dynamic import: `const compile = (await import('wat-compiler')).default`.Validate WAT syntax with `wat2wasm` or check the WebAssembly specification. Ensure the module has a `(module ...)` wrapper.
Use `import compile from 'wat-compiler'` (default import).
No dependency data recorded yet.