quickjs-emscripten
Version:
2 lines • 900 B
JavaScript
import{DEBUG_ASYNC,DEBUG_SYNC,RELEASE_ASYNC,RELEASE_SYNC,newQuickJSAsyncWASMModule,newQuickJSWASMModule}from"./chunk-OHAYRCBA.mjs";export*from"quickjs-emscripten-core";var singleton,singletonPromise;async function getQuickJS(){return singletonPromise??(singletonPromise=newQuickJSWASMModule().then(instance=>(singleton=instance,instance))),await singletonPromise}function getQuickJSSync(){if(!singleton)throw new Error("QuickJS not initialized. Await getQuickJS() at least once.");return singleton}async function newAsyncRuntime(options){return(await newQuickJSAsyncWASMModule()).newRuntime(options)}async function newAsyncContext(options){return(await newQuickJSAsyncWASMModule()).newContext(options)}export{DEBUG_ASYNC,DEBUG_SYNC,RELEASE_ASYNC,RELEASE_SYNC,getQuickJS,getQuickJSSync,newAsyncContext,newAsyncRuntime,newQuickJSAsyncWASMModule,newQuickJSWASMModule};
//# sourceMappingURL=index.mjs.map