Skip to content

Commit

Permalink
Initial code commit
Browse files Browse the repository at this point in the history
  • Loading branch information
James Wright committed Sep 22, 2017
0 parents commit 1cbef98
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -0,0 +1 @@
node_modules
13 changes: 13 additions & 0 deletions hello.wasm
@@ -0,0 +1,13 @@
get_local 0
i64.const 0
i64.eq
if i64
i64.const 1
else
get_local 0
get local 0
i64.const 1
i64.sub
call 0
i64.mul
end
8 changes: 8 additions & 0 deletions index.html
@@ -0,0 +1,8 @@
<script>
'use strict';

fetch('/hello.wasm')
.then(res => res.arrayBuffer())
.then(bytes => WebAssembly.instantiate(bytes, {}))
.then(console.log);
</script>
43 changes: 43 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions package.json
@@ -0,0 +1,19 @@
{
"name": "hello-wasm",
"version": "0.0.1",
"description": "Hello World in WebAssembly",
"repository": "https://github.com/jamesseanwright/hello-wasm",
"scripts": {
"start": "static .",
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [
"webassembly",
"wasm"
],
"author": "James Wright <james@jamesswright.co.uk>",
"license": "ISC",
"devDependencies": {
"node-static": "0.7.10"
}
}

0 comments on commit 1cbef98

Please sign in to comment.