0.1.0 • Published 12 months ago
@hboot/rust-web-lib v0.1.0
A Simple Rust-Web lib project
源代码
extern crate wasm_bindgen;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
pub fn alert(s: &str);
}
#[wasm_bindgen]
pub fn greet(name: &str) {
alert(&format!("Hello, {}!", name));
}
npm 安装使用
$> npm install rust-web-lib
0.1.0
12 months ago