Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explain how to run WebAssembly module from browser console #65

Open
jspaaks opened this issue Sep 24, 2020 · 0 comments
Open

Explain how to run WebAssembly module from browser console #65

jspaaks opened this issue Sep 24, 2020 · 0 comments

Comments

@jspaaks
Copy link

jspaaks commented Sep 24, 2020

moved this snippet from https://github.com/NLESC-JCER/run-cpp-on-web/blame/2abe8c363736c4aae4f8176def9668bd531230ef/js-plot/README.md#L164-L181 to an issue:

<!--
TODO do we want to explain how we can run snippet below?

To run test the WebAssembly module in a web browser we can use it's build-in console

1. startup a web server to host newtonraphson.js and newtonraphson.wasm with `python3 -m http.server 8000`
2. goto webserver adress [http://localhost:8000](http://localhost:8080) in browser
3. open the console in the web browsers DevTools (press F12 to open)

Import the WebAssembly JavaScript binding file with

```javascript
const response = await fetch('http://localhost:8000/newtonraphson.js');
const text = await response.text();
eval(text);
const {NewtonRaphson} = await createModule();

-->

@sverhoeven sverhoeven changed the title decide what to do with hidden snippet from visualization blog Explain how to run WebAssembly module from browser console Sep 28, 2020
@sverhoeven sverhoeven removed the standup label Oct 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants