INNER CODE UNIT · TypeScript
init
uhyo/nitrogql · packages/loader-core/src/index.ts:9
export async function init() {
const wasm = await WebAssembly.compile(
await readFile(new URL("../wasm/graphql-loader.wasm", import.meta.url)),
);
const instance = (await WebAssembly.instantiate(wasm)) as WASMInstance;
const bin = new WASMBin(instance);
const debugFlag = !!process.env.NITROGQL_DEBUG;
instance.exports.init(+debugFlag);
return {
/**
* Initializes a task for converting one file.
* @param fileName
* @param source
*/