MCPcopy Create free account
hub / github.com/EmNudge/watlings / getWasmToolsParser

Function getWasmToolsParser

scripts/utils/getWastParser.mjs:26–36  ·  view source on GitHub ↗

@returns {WastParser}

()

Source from the content-addressed store, hash-verified

24
25/** @returns {WastParser} */
26async function getWasmToolsParser() {
27 return async (filePath) => {
28 const fileName = basename(filePath, ".wat");
29 const wasmPath = fileURLToPath(
30 new URL(`../../.cache/${fileName}.wasm`, import.meta.url)
31 );
32
33 // Use wasm-tools CLI to parse WAT into a WASM binary
34 await spawnPromise("wasm-tools", ["parse", filePath, "-o", wasmPath]);
35 };
36}
37
38export async function getWastParser() {
39 try {

Callers 1

getWastParserFunction · 0.85

Calls 1

spawnPromiseFunction · 0.85

Tested by

no test coverage detected