d2/d2js/js/src/wasm-loader.node.js

9 lines
272 B
JavaScript
Raw Normal View History

import { readFile } from "fs/promises";
import { fileURLToPath } from "url";
import { dirname, resolve } from "path";
const __dirname = dirname(fileURLToPath(import.meta.url));
export async function getWasmBinary() {
return readFile(resolve(__dirname, "./d2.wasm"));
}