Registry / serialization / watever

watever

JSON →
library0.5.2jsnpmunverified

watever is a bundler and transpiler for WebAssembly text format (WAT) modules, enabling seamless integration with JavaScript. Version 0.5.2, active development. It statically links WAT modules, tree-shakes bytecode, and generates JS wrappers with ESM exports. Unlike other WASM tools, watever focuses on WAT-first development, allowing complex JS imports (e.g., strings, async functions) directly from WAT without glue code.

npm install watever
INSTALL
IMPORT
SIG · WATEVER
W
watever
serializationjavascriptv0.5.2
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.

watever CLI
npx watever input.wat
watever input.wat
CLI command, not a JS import. Use npx for global-less execution.
generated module
import { logNumber } from './log-number.wat.js'
const { logNumber } = require('./log-number.wat.js')
Generated files are ESM-only; CJS require() fails.
default export
import mod from './mod.wat.js'
Default export is an object with all named exports. Available since v0.3.

Creates a WAT module with string import, bundles it, and calls the exported async function from JS.

// Install npm install watever // Create WAT file: helloworld.wat (module (import "js" "console.log#lift" (func $log (param i32))) (import "watever/glue.wat" "lift_raw_string" (func $lift_raw_string (param i32 i32) (result i32))) (data (i32.const 0) "Hello, world!") (func $hello (export "helloWorld") (call $lift_raw_string (i32.const 0) (i32.const 13)) call $log ) ) // Bundle npx watever helloworld.wat // Use generated JS module import { helloWorld } from './helloworld.wat.js'; await helloWorld(); // "Hello, world!"
watever --version
Debug
Known issues
gotchaAll exported functions become async due to WebAssembly.instantiate Promise
fix
Always use await when calling exported functions from JS.
affects: >=0.1
breakingImport paths with '#lift' suffix changed semantics
fix
Use 'console.log#lift' instead of 'console.log' for lifted functions; see docs.
affects: >=0.4
deprecatedThe --deno flag is experimental and may be removed
fix
Use Node.js for production; check Deno support status before using.
affects: >=0.5
gotchaString encoding expects UTF-8, but WAT data defaults to ASCII
fix
Ensure string literals in WAT data sections are UTF-8 encoded, or use escape sequences for non-ASCII.
affects: >=0.1
Errors
Common errors & fixes
Error: Cannot find module 'watever'
Global install not found or missing dependency
fix
Run 'npm install watever' locally and use 'npx watever'.
TypeError: logNumber is not a function
Forgot to await the async export
fix
Use 'await logNumber();' instead of 'logNumber();'.
SyntaxError: Unexpected token 'export'
Using require() on ESM-only generated module
fix
Use 'import' statement instead of require(), or rename file to .mjs.
Upgrade
Version history
0.5.2latest on npm
Audit
Dependencies
noderequiredCLI tool runs on Node.js
Agent activity
11 hits · last 30 days
node
10
OpenAI (training)
1
Resources
watever — npm install watever · libregistry