In webassembly.org, JS API page, the way to import WebAssembly in javascript is
fetch('example.wasm').then(response => response.arrayBuffer())
.then(bytes => instantiate(bytes, importObject))
.then(instance => instance.exports.e());
The js file emitted by emcc seems to do that.
But when I use wasm-pack for Rust's Cargo, the javascript file simply does import * as wasm from './example.wasm'
What's the difference between these two? Is direct import a newly supported feature? and when using the direct import how would I access WebAssembly's memory from javascript since I didn't pass them to the WebAssembly module as I would do if I used the first method?