Packages

quickjs-wasi

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

Your version

0.2.0

7 Mar 2026Where it was published

In short

1 breaking6 new

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

Release note

Minor Changes

  • 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:

    • vm.newSymbolFor(description) — create global symbols (Symbol.for())

    • vm.setProp(obj, symbolHandle, value) / vm.getProp(obj, symbolHandle) — get/set properties using symbol keys

    • dump() returns real host Symbol.for(description) for global symbols

    • hostToHandle() converts host Symbol.for() values to QuickJS global symbols

    • Local (anonymous) symbols dump as the string "Symbol(description)" and throw if passed to hostToHandle()

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

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.