(module
  (import "env" "greet" (func $greet))

  (func
    ;; call the greet function
    call $greet
  )

  (start 1) ;; run the first function automatically
)
var url = "{%wasm-url%}";
await WebAssembly.instantiateStreaming(
  fetch(url),
  {
    env: {
      greet: function() {
        console.log("Hello");
      }
    }
  }
);

Wat Demo: call