Crates.io | rustpython_wasm |
lib.rs | rustpython_wasm |
version | 0.4.0 |
source | src |
created_at | 2023-09-06 09:48:16.878306 |
updated_at | 2024-08-07 00:06:56.941342 |
description | A Python-3 (CPython >= 3.5.0) Interpreter written in Rust, compiled to WASM |
homepage | |
repository | https://github.com/RustPython/RustPython/tree/main/wasm/lib |
max_upload_size | |
id | 965128 |
size | 80,180 |
A Python-3 (CPython >= 3.8.0) Interpreter written in Rust.
Using this in a production project is inadvisable. Please only do so if you understand the risks.
pyEval(code, options?);
code
: string
: The Python code to run
options
:
vars?
: { [key: string]: any }
: Variables passed to the VM that can be
accessed in Python with the variable js_vars
. Functions do work, and
receive the Python kwargs as the this
argument.stdout?
: "console" | ((out: string) => void) | null
: A function to replace the
native print function, and it will be console.log
when giving undefined
or "console", and it will be a dumb function when giving null.This project is licensed under the MIT license.