quickjs-wasi
3.7.0 · 13 Nov 2026MIT14.3M / weekRepositoryHomepagenpmAtom feed
In short
1 breaking6 new
- Breaking
HostFunctiontype now uses TypeScript'sthisparameter instead of a leading_thisargument. Thethisvalue from QuickJS is bound as the nativethisof the callback.
Release note
Minor Changes
- Breaking
HostFunctiontype now uses TypeScript'sthisparameter instead of a leading_thisargument. Thethisvalue from QuickJS is bound as the nativethisof 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()andQuickJS.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 keysdump()returns real hostSymbol.for(description)for global symbolshostToHandle()converts hostSymbol.for()values to QuickJS global symbolsLocal (anonymous) symbols dump as the string
"Symbol(description)"and throw if passed tohostToHandle()
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.