#codegen #javy #js #generator #plugin #wasm-module #path

javy-codegen

Wasm generation library for use with Javy

1 stable release

new 1.0.0 Mar 10, 2025

#1620 in WebAssembly

47 downloads per month

Apache-2.0 WITH LLVM-exception

48KB
902 lines

javy-codegen

A crate for generating Wasm modules using Javy

Documentation Status crates.io status

Refer to the crate level documentation to learn more.

Example usage:

use std::path::Path;
use javy_codegen::{Generator, LinkingKind, Plugin, JS};

fn main() {
  // Load your target Javascript.
  let js = JS::from_file(Path::new("example.js"));

  // Load existing pre-initialized Javy plugin.
  let plugin = Plugin::new_from_path(Path::new("example-plugin.wasm"));

  // Configure code generator.
  let mut generator = Generator::new();
  generator.plugin(plugin);
  generator.linking(LinkingKind::Static);

  // Generate your Wasm module.
  let wasm = generator.generate(&js)?;
}

Dependencies

~83MB
~1.5M SLoC