Packages

quickjs-wasi

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

Your version

27 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.

  1. 3.x · latest line
  2. 3.7.0

    13 Nov 2026

    Summary· from the note as AI read it

    Read before upgrading: 1 change to make.

  3. 3.6.4

    6 Nov 2026

    Summary· from the note as AI read it

    Read before upgrading: 1 change to make.

  4. 3.6.3

    19 Oct 2026
    • Release both deferred promise resolvers after the first settlement so the unused resolver does not retain the promise and its payload until VM disposal.

  5. 3.6.2

    19 Sep 2026
    • Update QuickJS-NG to v0.17.0, replacing the unreleased commit pin with an upstream release that includes WASI stack overflow protection.

  6. 3.6.1

    17 Sep 2026
    • Settle synchronous module namespace promises without draining unrelated guest jobs. Preserve deferred resolution for asynchronous modules and namespaces exporting then.

    • Include the wrapper's MIT license and copyright notice in the npm package.

  7. 3.6.0

    25 Aug 2026
    • Add the maxStackSize option and MAX_STACK_SIZE ceiling so WASI stack
      overflow can be caught by guest JavaScript without exhausting the physical
      WebAssembly stack.

  8. 3.5.0

    20 Aug 2026
    • Security

      Update quickjs-ng from v0.15.1 to v0.16.2: brings the iterator chunking/includes/join proposals, the Error.prototype.stack accessor proposal, a faster register-based regexp engine, a new arena allocator, and many correctness/security fixes.

    • Add handle.className: the engine-level class name of a value (e.g. "Map", "Date", "URL") read trap-free from the class table — unlike constructorName, it executes no guest code and cannot be spoofed by prototype/constructor reassignment.

    • Add vm.markPromiseHandled(promise): suppress the onUnhandledRejection callback for a promise whose rejection the host observes through other means.

  9. 3.4.0

    6 Aug 2026
    • Strings now cross the WASM boundary losslessly in both directions — embedded NULs and lone surrogates survive toString(), newString(), evalCode() sources, property keys, and enumeration.

    • Add vm.exportHandle() / vm.importHandle() for snapshot-portable handle tokens, enabling pre-snapshot captures to be re-materialized in restored VMs without executing guest code.

  10. 3.3.1

    4 Aug 2026
    • Host-callback this/argument handles are now "borrowed": exempt from withScope() tracking and dispose() is a no-op. Their pointers are owned by the C trampoline (which frees them after the call returns), so a scope active around guest execution — or an explicit dispose inside a callback — previously double-freed the guest values and corrupted the heap. Callbacks retain arguments past their invocation via dup(), which takes an owned reference and behaves normally.

    • Calling a guest function whose host callback is not registered now throws inside the guest (catchable, or surfaced as a host exception when uncaught), as the newEphemeralFunction and unregisterHostCallback docs already promised — previously it silently returned undefined, masking bugs like un-re-registered callbacks after a snapshot restore.

    • memoryLimit now actually bounds retained memory: the runtime is created with malloc functions that use wasi-libc's malloc_usable_size, replacing quickjs-ng's default usable-size which returns 0 on wasm32-wasi. Previously every allocation was accounted as overhead only, so retained ArrayBuffers/TypedArrays (and all other allocations) grew real memory without bound under any limit — reaching GiB under an 8 MiB memoryLimit — and getMemoryUsage().mallocSize stayed near zero. Workloads near their configured limit may now throw where they silently over-allocated before; raise memoryLimit to match actual usage.

  11. 3.3.0

    31 Jul 2026
    • Add handle.disposed: whether dispose() has been called on a handle.

    • Add handle.identity: a numeric identity for the underlying heap value, for deduplication and cycle detection across handles.

    • Add handle.toBoolean(): extract a value as a boolean, applying JavaScript truthiness.

  12. 3.2.0

    23 Jul 2026
    • Add trap-free introspection primitives: isProxy, isMap, isSet, isDate, isRegExp, isWeakRef, isWeakMap, isWeakSet, isDataView, and classId brand checks; getProxyTarget()/getProxyHandler() for trap-free Proxy internals access; getOwnPropertyKeys() (Reflect.ownKeys semantics, string + symbol keys); and getOwnPropertyDescriptor() which reads property descriptors without invoking getters. All primitives are engine-level checks that never execute guest code and cannot be spoofed by prototype/constructor mutation.

  13. 3.1.0

    21 Jul 2026
    • Security

      Resolve Dependabot security advisories by updating dev/demo dependencies and
      adding pnpm overrides for transitive packages pinned to vulnerable versions.
      Also move the repo-only pnpm configuration (overrides, onlyBuiltDependencies)
      out of package.json and into pnpm-workspace.yaml so it is no longer included
      in the published package. The published artifact has no JS dependencies, so this
      does not affect consumers at runtime.

    • Module evaluation now resolves to the module namespace object (its exports).

      Previously, evaluating code with EvalFlags.TYPE_MODULE (via evalCode() or
      evalBytecode()) returned a promise that resolved to undefined, making it
      impossible to access a module's exports from the host. The evaluation promise
      is now chained so it resolves to the module's namespace object instead
      matching quickjs-emscripten's behavior:

      using promise = vm.evalCode('export default 42', '<eval>', EvalFlags.TYPE_MODULE);
      vm.executePendingJobs();
      const result = await vm.resolvePromise(promise);
      if ('value' in result) {
        result.value.getProp('default').consume(h => h.toNumber()); // 42
      }

      Rejections (a throw during module evaluation) propagate through the returned
      promise unchanged. Fixes #22.

    • Improve module loader error handling:

  14. 3.0.2

    27 Jun 2026
    • Optimize WASM binary sizes. The build now compiles with -Oz, strips debug
      info at link time, and runs binaryen's wasm-opt -Oz as a post-link pass
      applied to both quickjs.wasm and all extension .so files. Total shipped
      binary size drops from 2.61 MB to 1.10 MB (-58%); quickjs.wasm specifically
      goes from 1.52 MB to 597 KB (-62%). Override the optimization level with
      make OPT=-O2 to favor runtime speed over size.

  15. 3.0.1

    17 Jun 2026
    • Fix value corruption when transferring objects/arrays containing false, true, null, or undefined into the VM via hostToHandle. These primitives resolve to cached singleton handles, and the object/array conversion disposed each value handle after setProp, freeing the singleton's shared heap JSValue and corrupting later reads (e.g. false showing up as NaN). Disposing a cached singleton handle is now a no-op.

    • Update QuickJS-ng from v0.15.0 to v0.15.1. This is an upstream bug-fix release: uncaught error dumps now walk the cause chain, and growable SharedArrayBuffers are rejected when no SAB hooks are configured. No public API changes.

  16. 3.0.0

    24 May 2026
    • 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 }],
      });
    • Update QuickJS-ng from v0.13.0 to v0.15.0 (bumps through v0.14.0). Highlights:

      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).

  17. 2.x
  18. 2.2.0

    6 Apr 2026
    • Security

      Add intrinsics option to QuickJS.create() for controlling which built-in JavaScript features are available in the VM. Pass a bitmask of Intrinsics.* flags to create a minimal sandbox — for example, omit Intrinsics.PROXY to disallow Proxy, or omit Intrinsics.DATE to remove Date. Useful for security hardening or reducing memory usage. Note: Intrinsics.EVAL must be included for vm.evalCode() to work; without it, only pre-compiled bytecode via vm.evalBytecode() can be executed.

    • Add vm.compile() and vm.evalBytecode() for bytecode compilation. Compile JavaScript source to a portable Uint8Array bytecode without executing it, then execute it later — even in a different VM instance. Also adds CompileFlags.STRIP_SOURCE and CompileFlags.STRIP_DEBUG for smaller bytecode output.

    • Add timezoneOffset option to QuickJS.create() for configuring the timezone used by Date inside the sandbox. Defaults to 'host' which mirrors the host environment's timezone. Can also be set to a fixed offset in minutes or a callback for DST-aware logic.

  19. 2.1.0

    30 Mar 2026
    • Add EvalFlags constants export and an optional flags parameter to evalCode(). The EvalFlags.ASYNC flag enables native top-level await support in evaluated scripts — the result is a Promise that resolves to the script's completion value. This is cleaner than wrapping code in an async IIFE, as it preserves last-expression-value semantics and avoids regex-based await detection.

    • Add Uint8Array base64/hex methods to the base64 extension per the TC39 proposal-arraybuffer-base64 (Stage 4): Uint8Array.prototype.toBase64(), Uint8Array.prototype.toHex(), Uint8Array.fromBase64(), Uint8Array.fromHex(), Uint8Array.prototype.setFromBase64(), and Uint8Array.prototype.setFromHex().

    • Update QuickJS-ng from v0.12.1 to v0.13.0. Includes bug fixes for FinalizationRegistry, async generators, regex engine, Iterator, and TypedArray, as well as performance improvements for String.prototype.concat, Promise creation, regexp operations, and context creation.

  20. 2.0.1

    19 Mar 2026
    • Add ./package.json sub-export to the exports map

    • Replace - with _ in extension name when deriving the default initFn, since hyphens are not valid in C function names

  21. 2.0.0

    17 Mar 2026
    • Breaking

      Replace opaque integer callback IDs with string names for host callbacks. registerHostCallback() now takes the function name instead of a numeric ID, making restore order-independent and self-documenting. newFunction() enforces unique names to prevent silent conflicts.

    • Use new URL(import.meta.url) pattern in extension files for consistent @vercel/nft asset tracing

    • Rebuild WASM artifacts with wasi-sdk 32 (clang 22.1.0), upgraded from wasi-sdk 30 (clang 21.1.4).

  22. 1.x
  23. 1.3.0

    16 Mar 2026
    • Add Web Crypto API extension (quickjs-wasi/crypto) backed by mbedTLS 4.0 PSA Crypto

    • Fix resolveModule() to use new URL() pattern recognized by @vercel/nft, ensuring quickjs.wasm is included in traced file lists

  24. 1.2.0

    12 Mar 2026
    • Add defineProp() method on both QuickJS and JSValueHandle for defining properties with explicit descriptor flags (writable, enumerable, configurable), similar to Object.defineProperty(). Accepts string or JSValueHandle keys, supporting symbols.

    • Add native WASM Headers extension implementing the WHATWG Fetch Standard Headers API. Supports constructor (record, sequence, or Headers init), append, delete, get, getSetCookie, has, set, entries, keys, values, forEach, and Symbol.iterator with spec-compliant case-insensitive name matching, value normalization, sorted iteration, and Set-Cookie handling.

    • Fix native extension global property descriptors to match web browser behavior. TextEncoder, TextDecoder, URL, and URLSearchParams are now defined as writable and configurable but not enumerable on globalThis, matching how browsers define them. btoa, atob, and structuredClone were already correct.

  25. 1.1.0

    11 Mar 2026
    • Add quickjs-wasi/base64 sub-export with WHATWG-compliant atob and btoa

    • Add quickjs-wasi/encoding sub-export with WHATWG-compliant TextEncoder and TextDecoder

    • Add quickjs-wasi/structured-clone sub-export with WHATWG-compliant structuredClone

  26. 1.0.0

    9 Mar 2026
    • Breaking

      evalCode() and callFunction() now throw a JSException directly when the evaluated code or called function throws, matching standard JavaScript semantics. The unwrapResult() method and isException property have been removed — exceptions propagate naturally via try/catch.

    • Add JSException class that extends Error and is thrown by unwrapResult(). It exposes a handle property — a live JSValueHandle to the QuickJS exception value — allowing direct inspection of custom properties on the thrown error. Also fixes a bug where errors thrown from host callbacks were returned as regular values instead of being propagated as QuickJS exceptions.

    • Add native WASM extension support via dynamic linking. Extensions are C-based WASM shared libraries that link directly against the QuickJS C API with zero marshalling overhead. Extensions are fully compatible with snapshot/restore. Includes a proof-of-concept URL and URLSearchParams extension.

  27. 0.2.x
  28. 0.2.0

    7 Mar 2026
    • Breaking

      HostFunction type now uses TypeScript's this parameter instead of a leading _this argument. The this value from QuickJS is bound as the native this of the callback.

      Before:

      vm.newFunction("add", (_this, ...args) => {
        return vm.newNumber(args[0].toNumber() + args[1].toNumber());
      });

      After:

      vm.newFunction("add", (...args) => {
        return vm.newNumber(args[0].toNumber() + args[1].toNumber());
      });

      To access this, use a regular function declaration:

      vm.newFunction("method", function (...args) {
        // `this` is the JSValueHandle for the QuickJS `this` value
        return this.getProp("name");
      });
    • Add QuickJS.serializeSnapshot() and QuickJS.deserializeSnapshot() for converting snapshots to/from a versioned binary format suitable for persistent storage (S3, databases, etc.). The format includes a magic header and version number for forward compatibility. Apply your own compression (gzip, zstd) on top for best results.

    • Add Symbol support:

      This enables the Workflow DevKit globalThis[Symbol.for("WORKFLOW_USE_STEP")] pattern.

  29. 0.1.x
  30. 0.1.0

    7 Mar 2026
    • Add ArrayBuffer and typed array marshalling: vm.newArrayBuffer(), vm.newUint8Array(), handle.toArrayBuffer(), handle.toUint8Array(). dump() returns proper ArrayBuffer / Uint8Array / typed array types. hostToHandle() converts ArrayBuffer, Uint8Array, and other typed arrays.

    • Add Promise support to hostToHandle(). Host Promises are automatically bridged to QuickJS promises via Deferred, with executePendingJobs() called on resolution/rejection.

    • Add interruptHandler option to QuickJSOptions. Called periodically during JS execution — return true to interrupt with an exception. Useful for implementing execution timeouts or step limits to prevent infinite loops. The VM remains usable after an interrupt.

  31. 0.0.x
  32. 0.0.0 – 0.0.12 releases without a noteShow each

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.