Web Assembly exercise project
- Run
nvm use
andnpm i
- Compile code inside
assembly/index.ts
to WebAssembly withnpm run asbuild
- The module exposes functions
minusOne
,fizzbuzz
andreadMemory
which all accept one number - Start web server to serve the module with
npm start
-> you should see the output of the functions in the browser and the console. - To use module in Node REPL run
node --experimental-repl-await
and then import the module withlet iwasm = await import('iwasm');
-> function can then be called like soiwasm.minusOne(number)