Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
meheleventyone authored Nov 20, 2018
1 parent ce2ab2f commit e9d5568
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,27 @@
# zig-wasm-test
A minimal Web Assembly example built from Zig's init-lib.

I expanded on this great gist from @josephg:
https://gist.github.com/josephg/873a21d4558fd69aeccea19c3df96672

To build this project you need to follow the steps there to get a wasm enabled version of LLVM setup.

## Building

To build this project with a working Zig and TypeScript install at the project root just type.

```
zig build -Drelease-small
```

You need to move the resulting wasmtest.wasm file from /zig-cache/ to /www/. One has been committed if you're happy omitting this step.

For good measure you can then build the TypeScript file:

```
cd www
tsc wasmtest.ts
```

# Running
Start the web server of your choice serving the www folder and navigate to wasmtest.html in your browser of choice. The value 7 should be output in the console.

0 comments on commit e9d5568

Please sign in to comment.