The @everruns/bashkit-wasm package is a slim, single-threaded WebAssembly module designed for any JavaScript host, including browsers, edge/serverless workers (Cloudflare Workers, Vercel Edge, Deno Deploy), Node, Deno, and Bun.
Unlike the native @everruns/bashkit (napi) package, this version does not require SharedArrayBuffer or cross-origin isolation (COOP/COEP) headers, making it suitable for embedded contexts and constrained edge runtimes.
Key Features:
- Full bash syntax and text-tool builtins (
grep, sed, awk, find, jq, etc.). - Binary-safe virtual filesystem (VFS).
- Support for JS custom builtins (both sync and async).
- Streaming output and cancellation.
- Static script analysis.
Limitations:
- No Network/Sockets:
http_client (curl/wget) and ssh are absent. To access the network, implement a custom JS builtin that calls the host's fetch. - No Threads: It is strictly single-threaded.
- No
tzdata: To keep the binary size small, the IANA database is omitted. Using a named TZ= zone (e.g., TZ=America/New_York) will cause the date command to fail with an error. Use TZ=UTC or leave it unset.
import { initBashkit, Bash } from '@everruns/bashkit-wasm';
// Initialize the WASM module once
await initBashkit();
// Construct the Bash instance
const bash = new Bash();