Crates.io | wasmedge_quickjs |
lib.rs | wasmedge_quickjs |
version | 0.2.0 |
source | src |
created_at | 2021-10-07 06:59:18.422745 |
updated_at | 2021-10-07 06:59:18.422745 |
description | Create your own JavaScript runtime and extension APIs for WasmEdge. |
homepage | https://www.secondstate.io/ |
repository | https://github.com/second-state/wasmedge-quickjs |
max_upload_size | |
id | 461615 |
size | 1,358,698 |
Now supporting wasmedge socket for HTTP requests and Tensorflow in JavaScript programs!
Install Rust and wasmedge CLI tool.
Make sure that you use the -e all
option to install the WasmEdge Tensorflow extensions if you want to try the Tensorflow examples below.
rustup target add wasm32-wasi
$ cargo build --target wasm32-wasi --release
$ cd example_js
$ wasmedge --dir .:. ../target/wasm32-wasi/release/wasmedge_quickjs.wasm hello.js WasmEdge Runtime
$ cargo build --target wasm32-wasi --release
Bonus: This example also shows how to import another JavaScript file into the current program.
$ cd example_js
$ wasmedge --dir .:. ../target/wasm32-wasi/release/wasmedg_quickjs.wasm http_demo.js
Note: Build the QuickJS interpreter with the WasmEdge Tensorflow extension.
$ cargo build --target wasm32-wasi --release --features=tensorflow
$ cd example_js/tensorflow_lite_demo
$ wasmedge-tensorflow --dir .:. ../../target/wasm32-wasi/release/wasmedge_quickjs.wasm main.js
If you want to build a custom libquickjs.a to export some static c function.
See [quickjs-wasi]
run quickjs-wasi/lib/build.sh