javy-codegen

Crates.iojavy-codegen
lib.rsjavy-codegen
version2.0.0
created_at2025-03-10 14:57:55.609372+00
updated_at2025-08-29 17:35:51.416508+00
descriptionWasm generation library for use with Javy
homepagehttps://github.com/bytecodealliance/javy/tree/main/crates/codegen
repositoryhttps://github.com/bytecodealliance/javy/tree/main/crates/codegen
max_upload_size
id1586807
size158,462
javy-publish (github:bytecodealliance:javy-publish)

documentation

README

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)?;
}
Commit count: 1081

cargo fmt