1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-30 02:59:11 -05:00
denoland-deno/tests/specs/run/wasm_module/cjs_importing/setup.ts

8 lines
299 B
TypeScript
Raw Normal View History

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);
});