[WASM] – Implementation and first uses complete – User Surface

This depends on:

WASM User Surface:

entry.js

import(./abc.js”).then(abc => abc.doIt());

abc.js

import module from ./addition.wasm”;

export function doIt() {
  console.log(module.add(1, 2));
}

addition.wasm

Some binary code for the following wast
(module
  (export "add" 0)
  (func (param i32) (param i32) (result i32)
    (i32.add (get_local 0) (get_local 1))
  )
)

Author: Fantashit

1 thought on “[WASM] – Implementation and first uses complete – User Surface

  1. Hi,

    How can I know that I have to import() a module instead of “import … from”? Do I have to know that my module may use webassembly under the hood?

Comments are closed.