#codegen #javy #plugin #wasm-module #linker #js #javascript #path

javy-codegen

Wasm generation library for use with Javy

1 stable release

1.0.0 Mar 10, 2025

#1905 in WebAssembly

Download history 2/week @ 2025-04-12 2/week @ 2025-04-19 1/week @ 2025-05-03 10/week @ 2025-05-10 1/week @ 2025-05-17 150/week @ 2025-07-05

150 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

~89MB
~2M SLoC