--- id: quickjs-ng version: "0.16.0.1" license: unclear license_treatment: unclear maintenance: active --- # quickjs-ng — Thin Python wrapper of quickjs-ng License: unclear · Maintenance: active · Downloads: 128.7K/mo ## 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 above — 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 pip install quickjs-ng uv add quickjs-ng poetry add quickjs-ng ## Installing 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_current - Install friction: medium - Maintenance: active - Downloads: 128.7K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags javascript engine python, embed javascript in python, quickjs python wrapper, execute js from python, python javascript interop, javascript-embedding, sandboxing, scripting-engine [View on SkillFed](https://skillfed.io/packages/quickjs-ng) · [View on PyPI](https://pypi.org/project/quickjs-ng/)