An open API service indexing awesome lists of open source software.

https://github.com/rixrix/rust-wasm-greetings

This repository contains a simple demonstration of how to achieve interoperation between JavaScript and Rust.
https://github.com/rixrix/rust-wasm-greetings

nodejs rust rust-lang wasm wasm-bindgen

Last synced: 11 months ago
JSON representation

This repository contains a simple demonstration of how to achieve interoperation between JavaScript and Rust.

Awesome Lists containing this project

README

          

# Demo Rust + WASM

![Greetings](media/form-1.png)

A simple demo about

- calling JS functions from Rust
- calling Rust functions from JS

# Requirements

- NodeJS v18+ https://nodejs.org/en/download
- Rust, https://www.rust-lang.org/tools/install

# Install

- install npm packages
- install wasm-pack, via `cargo install wasm-pack`

# Building

```
$> wasm-pack build --target web
```

# Running

```
$> npx http-server
```

go to http://localhost:8080