Repolode
stencil-hq

stencil-hq/dquickts

A fork of QuickJS that can suspend running JavaScript, snapshot its whole heap, and resume it in another process, with native TypeScript support.

Stars
482
Forks
11
Open issues
3
Last commit
5 days ago

What is it?

dquickts is a fork of Fabrice Bellard's embeddable QuickJS engine. Its main addition is durable execution: a running program, even in the middle of a synchronous loop, can be paused, serialized to bytes, and resumed later in a different process. Snapshots capture the whole runtime, including objects, closures, pending promise jobs, loaded modules and the suspended call stack.

The fork also runs .ts, .mts and .cts files directly. The parser erases type annotations during parsing, so no separate transpile step is needed, and enums, namespaces, parameter properties and decorators compile to ordinary bytecode. A `qjs --drepl FILE` REPL saves the session after every command, so functions and variables survive restarts.

The project includes Rust bindings, a port of rquickjs, that expose suspension, snapshots and TypeScript evaluation. Incremental snapshots let a host store only small deltas against a shared base.

Key features

  • 01Suspend running JavaScript at a safepoint and resume it later from the exact instruction.
  • 02Write full, base or delta heap snapshots and read them back in a fresh runtime or process.
  • 03Run TypeScript files directly, with types erased at parse time and no bundler required.
  • 04Durable host calls let a script wait for a C function's result that arrives after a restart.
  • 05Provides a durable REPL where session state persists across quits and restarts.
  • 06Ships Rust bindings with suspension, snapshot and TypeScript support.

Use cases

  • Hibernating long-running or idle scripts to free memory and resuming them later.
  • Building workflows where a script waits hours for an external result, then continues in another process.
  • Splitting a long computation into slices that run on different worker processes.
  • Embedding a scripting engine in an application that needs TypeScript without a build step.

Quick start

  1. 1

    Clone the repository

    git clone https://github.com/stencil-hq/dquickts
  2. 2

    Enter the project directory

    cd dquickts
  3. 3

    Build qjs, qjsc and libquickjs.a

    make
  4. 4

    Run a TypeScript file with qjs

    ./qjs hello.ts

Things to know

  • No license was detected automatically, so check the repository's license terms before use.
  • Snapshot and session files only load into the same qjs build that wrote them.
  • The durable REPL does not provide the std and os modules.

Topics

#javascript-engine#typescript#embeddable#snapshots#serialization#repl#rust-bindings#durable-execution#hibernation#interpreter

FAQ

What is dquickts?
A fork of QuickJS that can suspend running JavaScript, snapshot its whole heap, and resume it in another process, with native TypeScript support. dquickts is a fork of Fabrice Bellard's embeddable QuickJS engine. Its main addition is durable execution: a running program, even in the middle of a synchronous loop, can be paused, serialized to bytes, and resumed later in a different process. Snapshots capture the whole runtime, including objects, closures, pending promise jobs, loaded modules and the suspended call stack.
Is dquickts free to use? What license does it have?
dquickts is open source under the Other license. Check the license terms before using it in commercial products.
Is dquickts still maintained?
Actively maintained. The last commit to dquickts was on Nov 3, 2026.
What can I use dquickts for?
Hibernating long-running or idle scripts to free memory and resuming them later. Building workflows where a script waits hours for an external result, then continues in another process. Splitting a long computation into slices that run on different worker processes. Embedding a scripting engine in an application that needs TypeScript without a build step.
How do I install dquickts?
Clone the repository: git clone https://github.com/stencil-hq/dquickts Enter the project directory: cd dquickts Build qjs, qjsc and libquickjs.a: make Run a TypeScript file with qjs: ./qjs hello.ts
Where can I get dquickts?
The source code and installation instructions are on GitHub: https://github.com/stencil-hq/dquickts

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects