aboutsummaryrefslogtreecommitdiff
path: root/vendor/wasm/README.md
blob: d0b0a2f6f2cd218c1a5547cd6935b9f662aaa2e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# WASM on the Web

This directory is for use when targeting the `js_wasm32` target and the packages that rely on it.

The `js_wasm32` target assumes that the WASM output will be ran within a web browser rather than a standalone VM. In the VM cases, either `wasi_wasm32` or `freestanding_wasm32` should be used accordingly.

## Example for `js_wasm32`

```js
<!-- Copy `vendor:wasm/js/runtime.js` into your web server -->
<script type="text/javascript" src="runtime.js"></script>
<script type="text/javascript">
	odin.runWasm(pathToWasm, consolePreElement);
</script>
```