quickjs-zh/QuickJS logo

quickjs-zh/QuickJS

Free

QuickJS是一个小型并且可嵌入的Javascript引擎,它支持ES2020规范,包括模块,异步生成器和代理器。

FreeFree tier
Type
Open Source

About quickjs-zh/QuickJS

QuickJS is a small, embeddable JavaScript engine that supports the ES2023 specification, including modules, async generators, and proxies. It optionally supports mathematical extensions such as BigInt, BigFloat, and operator overloading. Key highlights include a tiny footprint (a minimal "hello world" binary is approximately 210 KiB on x86), very fast startup (the full lifecycle of a runtime instance completes in under 300 microseconds, and the ECMAScript test suite of 77,000 tests runs in under 2 minutes on a single core), almost complete ES2023 support with partial ES2024 features, the ability to compile JavaScript source code into standalone executables with no external dependencies, a reference-counting garbage collector with cycle detection, and a built-in small standard library. It is designed for easy embedding in C/C++ applications and is ideal for resource-constrained environments.

Key Features

Tiny and embeddable: only a few C files, no external dependencies, ~210 KiB hello world on x86
Very fast startup: runtime lifecycle under 300 microseconds, 77,000 ECMAScript tests in under 2 minutes
Almost full ES2023 support, including modules, async generators, Annex B, and partial ES2024 features
Compiles JavaScript source code to standalone executables without external dependencies
Reference-counting garbage collector with cycle detection for low memory usage and deterministic behavior
Built-in small standard library with C library wrappers
Optional mathematical extensions: BigInt, BigFloat, operator overloading
Command-line interpreter (REPL) with syntax highlighting and context-aware completion
Supports binary JSON for efficient data interchange
ECMAScript module support (ES6 modules) with automatic detection

Pros & Cons

Pros
  • Extremely small footprint and fast startup compared to other engines
  • Full ES2023 support with high test262 pass rate
  • No external dependencies, easy to build and integrate
  • Can compile JavaScript to standalone binaries
  • Efficient memory management with reference counting and cycle detection
  • Open source under a permissive license (MIT-like)
Cons
  • Smaller ecosystem and fewer libraries compared to V8 or SpiderMonkey
  • Limited debugging and developer tooling outside of basic REPL
  • Not designed for high-throughput server-side applications like Node.js
  • Documentation is primarily in Chinese for this fork, may be less accessible to non-Chinese speakers

Best For

Embedding a JavaScript engine in C/C++ applicationsScripting and automation in resource-constrained environments (e.g., IoT, microcontrollers)Compiling JavaScript into standalone executables for distribution without a runtime dependencyRunning JavaScript as a lightweight alternative to Node.js for simple scriptsEducational purposes or testing ECMAScript compliance

FAQ

What ECMAScript version does QuickJS support?
QuickJS supports almost all of ES2023 and partial ES2024 features, passing nearly 100% of the ECMAScript test suite.
How small is QuickJS?
A minimal 'hello world' program compiled with QuickJS is approximately 210 KiB on x86, and the engine itself consists of just a few C files with no external dependencies.
Can QuickJS be used to create standalone executables?
Yes, the qjsc compiler can compile JavaScript source code into standalone executables that require no external runtime or libraries.
Does QuickJS support BigInt and BigFloat?
Yes, QuickJS optionally supports BigInt, BigFloat, and operator overloading through its mathematical extensions.
What is the license for QuickJS?
QuickJS is open source; the repository includes a LICENSE file. The original QuickJS by Fabrice Bellard is licensed under the MIT license.