mirror of
https://github.com/denoland/deno.git
synced 2024-12-19 05:45:09 -05:00
8 lines
299 B
TypeScript
8 lines
299 B
TypeScript
|
fetch("http://localhost:4545/wasm/math.wasm").then(async (response) => {
|
||
|
if (!response.ok) {
|
||
|
throw new Error(`Failed to fetch WASM module: ${response.statusText}`);
|
||
|
}
|
||
|
using file = Deno.openSync("math.wasm", { write: true, create: true });
|
||
|
await response.body!.pipeTo(file.writable);
|
||
|
});
|