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

Publishing to crates.io

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

Using a custom WASI SDK

This crate can be compiled using a custom WASI SDK. When building this crate, set the QUICKJS_WASM_SYS_WASI_SDK_PATH environment variable to the absolute path where you installed the SDK.