quickjs-wasi
3.7.0 · 13 Nov 2026MIT14.3M / weekRepositoryHomepagenpmAtom feed
0.2.0 is the newest release of 0.1.x.
In short
5 new5 fixed
Release note
Minor Changes
Add ArrayBuffer and typed array marshalling:
vm.newArrayBuffer(),vm.newUint8Array(),handle.toArrayBuffer(),handle.toUint8Array().dump()returns properArrayBuffer/Uint8Array/ typed array types.hostToHandle()convertsArrayBuffer,Uint8Array, and other typed arrays.Add
Promisesupport tohostToHandle(). Host Promises are automatically bridged to QuickJS promises viaDeferred, withexecutePendingJobs()called on resolution/rejection.Add
interruptHandleroption toQuickJSOptions. Called periodically during JS execution — returntrueto interrupt with an exception. Useful for implementing execution timeouts or step limits to prevent infinite loops. The VM remains usable after an interrupt.Add
memoryLimitoption toQuickJSOptions. Restricts how much memory the QuickJS runtime can allocate — when exceeded, allocations fail and surface as JS exceptions. The limit is re-applied afterQuickJS.restore().Add configurable WASI clock via
QuickJSOptions.wasi. Thewasi.now(clockId)option controls bothDate.now()/new Date()and theMath.random()PRNG seed at the engine level — no need to patch JS globals. QuickJS seeds its internal xorshift64* PRNG from the clock value during context creation, so two VMs created with the samenow()value produce identicalMath.random()sequences.
Patch Changes
dispose()now releases all references to the WASM module, instance, and internal state so the WASM linear memory can be garbage collected.JSValueHandle.dispose()is safe to call after the VM has been disposed (becomes a no-op).Fix handle leaks on VM dispose: free cached singleton handles and internally-owned handles (unresolved promise resolve/reject functions). Make
Deferred.settledlazy to avoid unnecessary QuickJS object allocation.Replace JSON.stringify hack in
dump()with native property enumeration viaJS_GetOwnPropertyNames. Handles circular references gracefully (returnsundefined). Functions now dump asundefinedinstead of empty objects.Preserve circular and shared references in
dump(). Instead of returningundefinedfor circular references,dump()now returns the same host object — preserving the reference structure on the host side.Simplify
dispose()to just mark the VM as unusable. The WASM instance and its linear memory are garbage collected by the host JS engine — no need to explicitly callJS_FreeRuntime. RemovesleakCheckparameter fromdispose().
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.