quickjs-ng
Thin Python wrapper of quickjs-ng
What it is and what it does
quickjs-ng is a Python wrapper around the actively maintained quickjs-ng JavaScript engine, allowing you to evaluate JavaScript expressions and call JavaScript functions from Python, and vice versa. It is a drop-in replacement for the archived quickjs package, so existing code using `import quickjs` continues to work unchanged.
The package provides a Context object for isolated JavaScript execution, a Function helper for thread-safe calls from multiple threads, and resource controls (memory limits, CPU time limits, stack size). Each Context owns its own QuickJS runtime with no shared state; threading is handled either by creating one Context per thread or by using the Function wrapper, which manages a dedicated worker thread internally. Pre-built wheels are available for Linux, Windows, and macOS across CPython 3.10+ and PyPy 3.10/3.11.
Use it for:
- Execute untrusted or sandboxed JavaScript code with enforced memory and CPU time limits
- Call JavaScript utility functions or libraries from a Python application without Node.js
- Prototype or test JavaScript logic within a Python test suite or data pipeline
- Embed a lightweight scripting layer in Python applications for user-provided expressions
- Migrate from the archived quickjs package with minimal code changes
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Embeds and executes JavaScript code within Python using the quickjs-ng engine, allowing bidirectional calls between Python and JavaScript with resource limits and thread-safe execution patterns.
Yes, with conditions. The package is actively maintained, has no known vulnerabilities, and offers a clean API for JavaScript embedding. However, verify the actual license text before use in proprietary projects, since metadata shows 'unclear' despite the description mentioning MIT. Install friction is medium due to the C extension, but pre-built wheels cover common platforms. Suitable for sandboxed script execution, prototyping, and projects that need lightweight JavaScript evaluation without a full Node.js runtime.
Install
quickjs-ng on PyPI
pip
pip install quickjs-nguv
uv add quickjs-ngpoetry
poetry add quickjs-ngInstalling quickjs-ng
Before you install
Medium install friction due to compiled C extension wheels; however, pre-built wheels cover major platforms (Linux x86_64/i686/aarch64, Windows, macOS arm64) for CPython 3.10+ and PyPy 3.10/3.11, reducing build-from-source scenarios. Active maintenance with recent releases.
License in practice
License treatment is unclear—no SPDX identifier or raw license text is declared in package metadata. Verify the actual license (the description mentions MIT) before use in proprietary or restricted-license projects.
Quickstart
pip install quickjs-ng
import quickjs
ctx = quickjs.Context()
result = ctx.eval("1 + 2")
print(result) # 3
# Call JS function from Python
ctx.eval("function add(a, b) { return a + b; }")
add = ctx.get("add")
print(add(3, 4)) # 7
Requires Python ≥ 3.10. A C compiler is needed only if building from source; pre-built wheels are available for common platforms.
Verify before relying
- Actual license text and SPDX identifier (metadata shows 'unclear' despite description mentioning MIT)
- Performance characteristics and memory overhead compared to other JavaScript embedding solutions
- Stability and API surface coverage relative to the original quickjs package
Package facts
| License | not declared (unclear) |
| Python support | supports the current Python release (<4.0,>=3.10) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 13 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 128,737/month — #11,696 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: quickjs_ng-0.16.0.1-cp310-abi3-macosx_11_0_arm64.whl; quickjs_ng-0.16.0.1-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; quickjs_ng-0.16.0.1-cp310-abi3-manylinux2014_i686.manylinux_2_17_i686.manylinux_2_28_i686.whl; quickjs_ng-0.16.0.1-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; quickjs_ng-0.16.0.1-cp310-abi3-musllinux_1_2_aarch64.whl; quickjs_ng-0.16.0.1-cp310-abi3-musllinux_1_2_i686.whl; quickjs_ng-0.16.0.1-cp310-abi3-musllinux_1_2_x86_64.whl; quickjs_ng-0.16.0.1-cp310-abi3-win32.whl; quickjs_ng-0.16.0.1-cp310-abi3-win_amd64.whl; quickjs_ng-0.16.0.1-pp310-pypy310_pp73-macosx_11_0_arm64.whl; quickjs_ng-0.16.0.1-pp310-pypy310_pp73-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; quickjs_ng-0.16.0.1-pp310-pypy310_pp73-manylinux2014_i686.manylinux_2_17_i686.manylinux_2_28_i686.whl; quickjs_ng-0.16.0.1-pp310-pypy310_pp73-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; quickjs_ng-0.16.0.1-pp310-pypy310_pp73-win_amd64.whl; quickjs_ng-0.16.0.1-pp311-pypy311_pp73-macosx_11_0_arm64.whl; quickjs_ng-0.16.0.1-pp311-pypy311_pp73-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; quickjs_ng-0.16.0.1-pp311-pypy311_pp73-manylinux2014_i686.manylinux_2_17_i686.manylinux_2_28_i686.whl; quickjs_ng-0.16.0.1-pp311-pypy311_pp73-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; quickjs_ng-0.16.0.1-pp311-pypy311_pp73-win_amd64.whl
Keywords: quickjs, javascript, embedding
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
quickjsWraps the QuickJS C library to execute…
unclear · top 5,000 on PyPI
quickjs-rsExecutes JavaScript code inside a WebAssembly…
permissive · top 15,000 on PyPI
mini-racerEmbeds Google's V8 JavaScript engine in Python,…
permissive · top 5,000 on PyPI
py-mini-racerEmbeds a modern V8 JavaScript engine in Python,…
permissive · top 5,000 on PyPI
langchain-quickjsAdds a persistent, sandboxed JavaScript REPL…
permissive · top 15,000 on PyPI
Js2PyJs2Py translates and executes JavaScript code…
permissive · top 5,000 on PyPI
Js2Py-3.13Js2Py translates and executes JavaScript code…
permissive · top 15,000 on PyPI
pscriptPScript compiles a Python subset to JavaScript,…
unclear · top 15,000 on PyPI
CoffeeScriptCompiles CoffeeScript code to JavaScript from…
permissive · top 15,000 on PyPI
dukpyDukPy is a JavaScript interpreter for Python…
permissive · top 15,000 on PyPI