Skip to content

Commit

Permalink
new ep
Browse files Browse the repository at this point in the history
  • Loading branch information
realtux committed Jun 7, 2020
1 parent 036dc7a commit c9d3367
Show file tree
Hide file tree
Showing 10 changed files with 3,687 additions and 0 deletions.
3 changes: 3 additions & 0 deletions 108/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
target/
dist/
package/
124 changes: 124 additions & 0 deletions 108/Cargo.lock

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

11 changes: 11 additions & 0 deletions 108/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[package]
name = "wasm_test"
version = "0.1.0"
authors = ["Engineer Man <[email protected]>"]
edition = "2018"

[lib]
crate-type = ["cdylib"]

[dependencies]
wasm-bindgen = "0.2.63"
1 change: 1 addition & 0 deletions 108/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import('./init.js');
5 changes: 5 additions & 0 deletions 108/init.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import * as wasm from './pkg';

let result = wasm.add(2, 8);

console.log(result);
19 changes: 19 additions & 0 deletions 108/notes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# get the necessary cargo stuff
cargo install wasm-pack

# make a new rust project and do your code
cargo init --lib

# make the package
wasm-pack build

# get the necessary npm stuff
npm install

# bundle everything
node_modules/.bin/webpack

# start the server
cd dist; ../node_modules/.bin/wasm-server

# go to http://127.0.0.1:3000
Loading

0 comments on commit c9d3367

Please sign in to comment.