{"id":28454,"library":"watever","title":"watever","description":"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.","status":"active","version":"0.5.2","language":"javascript","source_language":"en","source_url":"https://github.com/mitschabaude/watever","tags":["javascript","webassembly","bundler","build-tool"],"install":[{"cmd":"npm install watever","lang":"bash","label":"npm"},{"cmd":"yarn add watever","lang":"bash","label":"yarn"},{"cmd":"pnpm add watever","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"CLI tool runs on Node.js","package":"node","optional":false}],"imports":[{"note":"CLI command, not a JS import. Use npx for global-less execution.","wrong":"watever input.wat","symbol":"watever CLI","correct":"npx watever input.wat"},{"note":"Generated files are ESM-only; CJS require() fails.","wrong":"const { logNumber } = require('./log-number.wat.js')","symbol":"generated module","correct":"import { logNumber } from './log-number.wat.js'"},{"note":"Default export is an object with all named exports. Available since v0.3.","wrong":"","symbol":"default export","correct":"import mod from './mod.wat.js'"}],"quickstart":{"code":"// Install\nnpm install watever\n\n// Create WAT file: helloworld.wat\n(module\n  (import \"js\" \"console.log#lift\" (func $log (param i32)))\n  (import \"watever/glue.wat\" \"lift_raw_string\" (func $lift_raw_string (param i32 i32) (result i32)))\n  (data (i32.const 0) \"Hello, world!\")\n  (func $hello (export \"helloWorld\")\n    (call $lift_raw_string (i32.const 0) (i32.const 13))\n    call $log\n  )\n)\n\n// Bundle\nnpx watever helloworld.wat\n\n// Use generated JS module\nimport { helloWorld } from './helloworld.wat.js';\nawait helloWorld(); // \"Hello, world!\"","lang":"javascript","description":"Creates a WAT module with string import, bundles it, and calls the exported async function from JS."},"warnings":[{"fix":"Always use await when calling exported functions from JS.","message":"All exported functions become async due to WebAssembly.instantiate Promise","severity":"gotcha","affected_versions":">=0.1"},{"fix":"Use 'console.log#lift' instead of 'console.log' for lifted functions; see docs.","message":"Import paths with '#lift' suffix changed semantics","severity":"breaking","affected_versions":">=0.4"},{"fix":"Use Node.js for production; check Deno support status before using.","message":"The --deno flag is experimental and may be removed","severity":"deprecated","affected_versions":">=0.5"},{"fix":"Ensure string literals in WAT data sections are UTF-8 encoded, or use escape sequences for non-ASCII.","message":"String encoding expects UTF-8, but WAT data defaults to ASCII","severity":"gotcha","affected_versions":">=0.1"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Run 'npm install watever' locally and use 'npx watever'.","cause":"Global install not found or missing dependency","error":"Error: Cannot find module 'watever'"},{"fix":"Use 'await logNumber();' instead of 'logNumber();'.","cause":"Forgot to await the async export","error":"TypeError: logNumber is not a function"},{"fix":"Use 'import' statement instead of require(), or rename file to .mjs.","cause":"Using require() on ESM-only generated module","error":"SyntaxError: Unexpected token 'export'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}