Packages

quickjs-wasi

3.7.0 · 13 Nov 2026MIT14.3M / weekRepositoryHomepagenpmAtom feed

Your version

3.0.0

major24 May 2026Where it was published

3.7.0 is the newest release of 3.x.

In short

1 breaking5 new

  • Breaking

    Stop performing implicit filesystem I/O. The caller is now always responsible for providing the WASM bytes (or a pre-compiled WebAssembly.Module) for both the main runtime and any native extensions, using whichever loading mechanism is appropriate for their environment (fetch(), node:fs/promises, bundler imports, etc.).

Release note

Major Changes

  • Breaking

    Stop performing implicit filesystem I/O. The caller is now always responsible for providing the WASM bytes (or a pre-compiled WebAssembly.Module) for both the main runtime and any native extensions, using whichever loading mechanism is appropriate for their environment (fetch(), node:fs/promises, bundler imports, etc.).

    Main runtime

    The wasm option on QuickJS.create() / QuickJS.restore() is now required — the previous node:fs/promises fallback has been removed. A new quickjs-wasi/quickjs.wasm subpath export points to the published .wasm binary so callers can resolve it through their bundler or runtime.

    Extensions

    The Node-only convenience wrappers (quickjs-wasi/url, quickjs-wasi/encoding, quickjs-wasi/base64, quickjs-wasi/headers, quickjs-wasi/crypto, quickjs-wasi/structured-clone) have been removed. Each extension's compiled .so is now exposed directly via quickjs-wasi/<name>.so (e.g. quickjs-wasi/url.so, quickjs-wasi/crypto.so) so it can be loaded the same way as the main runtime.

    Migration

    // Before
    import { QuickJS } from "quickjs-wasi";
    import { urlExtension } from "quickjs-wasi/url";
    const vm = await QuickJS.create({ extensions: [urlExtension] });
    
    // After (Node)
    import { readFile } from "node:fs/promises";
    import { QuickJS } from "quickjs-wasi";
    
    const wasm = await readFile(
      new URL(import.meta.resolve("quickjs-wasi/quickjs.wasm"))
    );
    const urlSo = await readFile(
      new URL(import.meta.resolve("quickjs-wasi/url.so"))
    );
    
    const vm = await QuickJS.create({
      wasm,
      extensions: [{ name: "url", wasm: urlSo }],
    });
    
    // After (Vite / bundlers)
    import wasmUrl from "quickjs-wasi/quickjs.wasm?url";
    import urlSoUrl from "quickjs-wasi/url.so?url";
    
    const wasm = await WebAssembly.compileStreaming(fetch(wasmUrl));
    const urlSo = await fetch(urlSoUrl).then((r) => r.arrayBuffer());
    
    const vm = await QuickJS.create({
      wasm,
      extensions: [{ name: "url", wasm: urlSo }],
    });

Minor Changes

  • Update QuickJS-ng from v0.13.0 to v0.15.0 (bumps through v0.14.0). Highlights:

    • atob() / btoa() are now native built-ins. They are controlled by a new Intrinsics.ATOB_BTOA flag, included in Intrinsics.ALL by default. Enabling this intrinsic also pulls in DOMException (errors thrown by these functions are DOMException instances).

    • Uint8Array base64/hex methods (toBase64, fromBase64, toHex, fromHex, setFromBase64, setFromHex) are now part of the native TypedArrays intrinsic.

    • Explicit Resource Management (using / await using in JavaScript) is now supported in the embedded VM.

    • New C API: JS_GetPendingJobContext, JS_IsAsyncFunction, JS_NewUint64, support for byte imports in modules, JSON.parse source text access.

    • Bug fixes for Iterator.concat reentrancy, fast array UAF + overflow, property set extensibility checks, atom leaks in JS_NewSymbol, big-endian builds, and stack-trace line numbers around for/of cleanup.

    Breaking — base64 extension removed. The quickjs-wasi/base64.so subpath export has been deleted because every feature it provided is now native in the runtime. To migrate, drop the extension from your extensions array — atob, btoa, and the Uint8Array base64/hex methods are available unconditionally (assuming you have not disabled Intrinsics.ATOB_BTOA or Intrinsics.TYPED_ARRAYS).

    The WASM toolchain also bumps to wasi-sdk 32 (clang 22.1.0).

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.