wasmjs
Simple Python wrapper around QuickJS-NG's qjs-wasi-reactor.wasm.
Quickstart
$ python -m venv my-project
$ source my-project/bin/activate
$ pip install wasmjs
$ python
>>> from wasmjs import wasmjs
>>> js = wasmjs.WasmJS()
>>> js.eval('1 + 2')
3
>>> js.eval('("hello" + "there").toUpperCase()')
'HELLOTHERE'
>>> js.eval('({one: 1, two: 2})')
{'one': 1, 'two': 2}
Structure
qjs-wasi-reactor.wasm is essentially 3 build targets statically linked together:
- QuickJS-NG JavaScript library (
JS_Eval, etc.) - QuickJS-NG
qjsCLI tool (qjs_init, etc.) - Bytecode Alliance
wasi-libcC standard library implementation (malloc, etc.)
The API bindings for each component are separated into:
WasmFileqjs-wasi-reactor.wasmloader. Wrapswasmtime-py, which itself wrapsWasmtime, which is a WebAssembly runtime.
api.wasilibcmallocthat changes the return type ofwasi-libc'smallocfrom anint32to auint32, etc.
api.memutil- Convenience functions to get strings and other complex types into and out of the Wasm virtual machine.
api.qjsJS_Evalthat keeps track of the global context, etc.
api.js- Convenience functions to handle all of the multi-step
qjsflows.
- Convenience functions to handle all of the multi-step
jsvalueutil- All of the logic needed to get data into and out of the JS virtual machine (inside the Wasm virtual machine).
WasmJS- Convenience layer to simplify all of the above.
Metadata
Release files for wasmjs 0.0.18.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| wasmjs-0.0.18.0.0.tar.gz | 13.0 kB | Without provenance | Details for wasmjs-0.0.18.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| wasmjs-0.0.18.0.0-py3-none-any.whl | Python 3 | none | any | Details for wasmjs-0.0.18.0.0-py3-none-any.whl |
Total release size: 23.8 kB
Release files / wasmjs-0.0.18.0.0.tar.gz
| Download URL | wasmjs-0.0.18.0.0.tar.gz |
|---|---|
| Size | 13.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
33808c6140e2cccf19162e62a6edf816610b4026309b0c53faa2c74b910ba064
|
|
BLAKE2b-256 checksum How to use checksums |
13a3b42e849ded38354cff14ab379e7bf5257444eb78c3f43c5d6d26ed933632
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.4
|
Release files / wasmjs-0.0.18.0.0-py3-none-any.whl
| Download URL | wasmjs-0.0.18.0.0-py3-none-any.whl |
|---|---|
| Size | 10.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4fea41522ecf41bb9c03e8e77116c8d29bb0619cd5d43b767e8dbee195cac350
|
|
BLAKE2b-256 checksum How to use checksums |
6d5eb397d3a5f7ca2748f4f67887f30292907c4e4885176d88ccc1a377bd83c3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.4
|
Security for wasmjs 0.0.18.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.