Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 

WasmRPC

WasmRPC is a standard format for Web Assembly modules that allows them to be run across multiple runtime implementations.

WasmRPC allows you to write the following rust code:

#[export]
fn hello(string: String) -> String {
    let mut new_string = string.clone();
    new_string.insert_str(0, "hello ");
    new_string
}

And call it from JavaScript like this:

import WasmRPC from 'wasm-rpc';

async function run() {
    const hello = new WasmRPC();
    await hello.loadFile('target/wasm32-unknown-unknown/debug/hello.wasm');
    let result = await hello.call("hello", "world");

    console.log(result);
    // -> "hello world"
}
run();

Read the WasmRPC specification here.

About

A standard for interfacing between WebAssembly and WebAssembly runtime environments

Resources

Releases

No releases published

Packages

No packages published