Skip to content

Instantly share code, notes, and snippets.

@zancas
Created April 17, 2020 16:01
Show Gist options
  • Save zancas/4e5341b0b8cc7115e73360e359b87cb8 to your computer and use it in GitHub Desktop.
Save zancas/4e5341b0b8cc7115e73360e359b87cb8 to your computer and use it in GitHub Desktop.
wasm-pack build output JS minimized
const init = async (input) => {
response = await fetch(browser.runtime.getURL(input));
const { instance } = await WebAssembly.instantiateStreaming(response);
console.log("finished instantiating");
return instance.exports;
};
(async () => {
const f = await init('target/wasm32-unknown-unknown/debug/webextension_bg.wasm');
console.log(f.add_one(1));
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment