javy-apis

A collection of APIs that can be added to a Javy runtime.

APIs are registered by enabling crate features.

Example usage

``rust use javy::{quickjs::JSValue, Runtime}; // withconsole` feature enabled use javy_apis::RuntimeExt;

fn main() -> Result<()> { let runtime = Runtime::newwithdefaults()?; let context = runtime.context(); context.eval_global("hello.js", "console.log('hello!');")?; Ok(()) } ```

If you want to customize the runtime or the APIs, you can use the Runtime::new_with_apis method instead to provide a javy::Config for the underlying Runtime or an APIConfig for the APIs.

Features

Building a project using this crate

For example, if you install the wasi-sdk in /opt/wasi-sdk, you can run: bash export QUICKJS_WASM_SYS_WASI_SDK_PATH=/opt/wasi-sdk

Publishing to crates.io

To publish this crate to crates.io, run ./publish.sh.