QuickJS is a small and embeddable Javascript engine. It supports the ES2020 specification including modules, asynchronous generators, proxies and BigInt.
It optionally supports mathematical extensions such as big decimal floating point numbers (BigDecimal), big binary floating point numbers (BigFloat) and operator overloading.
- Small and easily embeddable: just a few C files, no external dependency, 210 KiB of x86 code for a simple hello world program.
- Fast interpreter with very low startup time: runs the 69000 tests of the ECMAScript Test Suite in about 95 seconds on a single core of a desktop PC. The complete life cycle of a runtime instance completes in less than 300 microseconds.
- Almost complete ES2020 support including modules, asynchronous generators and full Annex B support (legacy web compatibility).
- Passes nearly 100% of the ECMAScript Test Suite tests when selecting the ES2020 features.
- Can compile Javascript sources to executables with no external dependency.
- Garbage collection using reference counting (to reduce memory usage and have deterministic behavior) with cycle removal.
- Mathematical extensions: BigDecimal, BigFloat, operator overloading, bigint mode, math mode.
- Command line interpreter with contextual colorization implemented in Javascript.
- Small built-in standard library with C library wrappers.
This reposistory is a mrirror of the original work that you can find here.
The main purpose of this reposistory is to build QuickJS static library that you could include on your C / C++ project. On release you can find the build for the following operating systems:
- Windows
- Ubuntu 20.04
- Ubuntu 18.04
- Linux arm64
- macOS
If you want to build the QuickJS library on your own the first step is to clone this repository:
> git clone https://github.com/napi-bindings/quickjs-build.git
You will need to install GCC for Windows and CMake.
- Download the mingw from this link.
- Be sure that gcc in in your path of execution.
- Download the right version for your system from this link.
- Be sure that cmake is in your path of execution.
Open your shell and execute the commands reported below:
mkdir ./build
cmake \
-DCMAKE_BUILD_TYPE=Release \
-G "MinGW Makefiles" \
-S ./ \
-B ./build
cmake --build ./build
-DCMAKE_BUILD_TYPE
could be set with one of the following two values:
- Release
- Debug
You will need to install C / C++ compiler and CMake.
These steps were tested on:
- Ubuntu 18.04
- Ubuntu 20.04
First, you will need to install dependencies:
sudo apt-get update
sudo apt-get install build-essential -y
sudo apt-get install cmake -y
These steps were tested on macOS Catalina (10.15).
First, you will need to install dependencies:
- Install Xcode
- You also need to install the
XCode Command Line Tools
by runningxcode-select --install
. Alternatively, if you already have the full Xcode installed, you can find them under the menuXcode -> Open Developer Tool -> More Developer Tools...
. This step will installclang
,clang++
, andmake
.
- You also need to install the
- Install Homebrew
- Install and
cmake
running the following command:
brew install cmake
Open your shell and execute the commands reported below:
mkdir ./build
cmake \
-DCMAKE_BUILD_TYPE=Release \
-G "Unix Makefiles" \
-S ./ \
-B ./build
cmake --build ./build
-DCMAKE_BUILD_TYPE
could be set with one of the following two values:
- Release
- Debug
- QuickJS documentation HTML version, PDF version.
- Specification of the JavaScript Bignum Extensions: HTML version, PDF version.
- Writing native modules in C for QuickJS.
- How to create asynchronous code for QuickJS.
https://github.com/NickNaso/
https://www.npmjs.com/~nicknaso
Thank you to all people that encourage me every day.
Licensed under Apache license V2