| Crates.io | zuqe |
| lib.rs | zuqe |
| version | 0.3.4 |
| created_at | 2026-01-12 13:02:53.411304+00 |
| updated_at | 2026-01-22 07:34:09.035827+00 |
| description | Zuqe JS Engine - A lightweight JS engine implemented in Rust, designed for embedded systems and general‑purpose use. |
| homepage | |
| repository | https://github.com/nupha/zuqe |
| max_upload_size | |
| id | 2037684 |
| size | 2,335,438 |
Zuqe (pronounced /zuːk/, like "zook") is a lightweight JavaScript engine implemented in Rust. It is designed for embedded systems and general‑purpose use, balancing performance, memory safety, and a minimal footprint.
Zuqe is named after 朱雀 (Zhuque), the Vermilion Bird of Chinese mythology, which represents fire and renewal.
Zuqe is inspired by QuickJS.
Zuqe implements a comprehensive set of ES2023+ features, making it suitable for modern JavaScript development:
Zuqe is under active development. It currently passes a substantial portion of the Test262 test suite and is evolving toward production readiness.
Cargo.tomlAdd zuqe to your dependencies in Cargo.toml:
[dependencies]
zuqe = "0.3.0"
The core of any zuqe application is the Runtime and Context. The Runtime manages the engine, while the Context provides an isolated environment for script execution.
use zuqe::{Runtime, Context};
let mut rt = Runtime::create().unwrap();
let mut ctx = rt.create_context_ecma().unwrap();
Use run_wait_with to execute JavaScript code within the context, wait till script exits.
use zuqe::{EvalFlags, EvalType};
let script = r#"
let greet = (name) => `Hello, ${name}!`;
greet("Zuqe");
"#;
let res = ctx.run_wait(
script.as_bytes(), // script content
"example.js", // filename
EvalType::Global, // global eval mode
EvalFlags::empty()
);
match res {
Ok(val) => {
println!("eval result: {val:?}");
}
Err(e) => {
let mut err_msg = e.message;
if let Some(tb) = e.traceback {
err_msg = format!("{err_msg}\n{tb}");
}
println!("error: {err_msg}");
}
}
For more comprehensive examples, check the examples directory which includes:
Zuqe is an open-source project and welcomes contributions! Whether you're fixing bugs, adding features, or improving documentation, your help is appreciated.
Licensed under the Apache License 2.0.
Copyright (c) 2025-2026 John Ray 996351336@qq.com All rights reserved.