mirror of
https://github.com/denoland/deno.git
synced 2025-12-23 08:48:24 +00:00
Support for Wasm modules.
Note this implements the standard where the default export is the
instance (not the module). The module will come later with source phase
imports.
```ts
import { add } from "./math.wasm";
console.log(add(1, 2));
```
8 lines
180 B
TypeScript
8 lines
180 B
TypeScript
// this file is imported by math_with_import.wasm
|
|
export function add(a: number, b: number) {
|
|
return a + b;
|
|
}
|
|
|
|
export function subtract(a: number, b: number) {
|
|
return a - b;
|
|
}
|