import { getModuleLoader } from 'emscripten-wasm-loader' ; import { CldAsmModule } from './cldAsmModule' ; import { CldFactory } from './cldFactory' ; import { cldLoader } from './cldLoader' ; import { log } from './util/logger' ; import * as runtime from './lib/node/cld3' ; param InitOptions param { number } InitOptions . timeout param { string | object } InitOptions . locateBinary returns { ( ) => Promise < CldFactory > } const loadModule = async ( initOptions = { } ) => { const { timeout } = initOptions ; log ( `loadModule: loading cld3 wasm binary` , { initOptions } ) ; const moduleLoader = await getModuleLoader < CldFactory , CldAsmModule > ( ( runtime ) => cldLoader ( runtime ) , runtime , undefined , { timeout } ) ; return moduleLoader ( ) ; } ; export { loadModule } ;