This is a boilerplate / demo of WebAssembly. It uses a very simple C++ function (which takes a number as an argument and returns its square) in a wasm module, which can then be accessed & used from within the JS file. As soon as you pull it up on a localhost, the demo is ready to go; no configuration or setup necessary.
I have used node server to run the this example. To run this demo open the cammand prompt and run below cammands.
- npm i
- node server that's it
Now Open debugger, go to console and type squarer(10)
For more info visit https://www.youtube.com/watch?v=5XtA3k07jEQ