How to use @wasmer/wasm-transformer - 2 common examples

To help you get started, we’ve selected a few @wasmer/wasm-transformer examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wasmerio / wasmer-js / packages / cli / src / commands / run.ts View on Github external
if (indexLimit > 0) {
      wasiArgs = [wasiArgs[0], ...wasiArgs.splice(indexLimit + 1)];
    }

    const wasi = new WASI({
      args: wasiArgs,
      bindings: {
        ...nodeBindings,
        fs
      },
      env: {},
      preopens
    });

    const wasmBytes = fs.readFileSync(args.file);
    const transformedBytes = await lowerI64Imports(wasmBytes);
    const { instance } = await WebAssembly.instantiate(transformedBytes, {
      wasi_unstable: wasi.wasiImport
    });
    wasi.start(instance);
  }
}
github wasmerio / wasmer-js / examples / wasm-shell / components / wasm-terminal.tsx View on Github external
} else {
      return customCommand;
    }
  } else {
    wasmBinary = await fetchCommandFromWAPM(
      commandName,
      commandArgs,
      envEntries
    );
  }

  if (!didInitWasmTransformer) {
    didInitWasmTransformer = true;
  }

  return await lowerI64Imports(wasmBinary);
};

@wasmer/wasm-transformer

Library to run transformations on WebAssembly binaries. 🦀♻️

MIT
Latest version published 4 years ago

Package Health Score

61 / 100
Full package analysis

Popular @wasmer/wasm-transformer functions

Similar packages