Big News: Socket Selected for OpenAI's Cybersecurity Grant Program.Details
Socket
Book a DemoSign in
Socket

quickjs-emscripten

Package Overview
Dependencies
Maintainers
1
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

quickjs-emscripten - npm Package Compare versions

Comparing version
0.25.0-rc.1
to
0.25.0-rc.2
+2
dist/chunk-4PPVDWQ2.mjs
import{newQuickJSWASMModuleFromVariant as i,newQuickJSAsyncWASMModuleFromVariant as o}from"quickjs-emscripten-core";import a from"#variants/debug";import r from"#variants/release";import J from"#variants/debug-asyncify";import n from"#variants/release-asyncify";async function s(S=r){return i(S)}async function y(S=n){return o(S)}export{a,r as b,J as c,n as d,s as e,y as f};
//# sourceMappingURL=chunk-4PPVDWQ2.mjs.map
{"version":3,"sources":["../src/variants.ts"],"sourcesContent":["import {\n QuickJSSyncVariant,\n QuickJSAsyncVariant,\n newQuickJSWASMModuleFromVariant,\n newQuickJSAsyncWASMModuleFromVariant,\n QuickJSWASMModule,\n QuickJSAsyncWASMModule,\n} from \"quickjs-emscripten-core\"\nimport DEBUG_SYNC from \"#variants/debug\"\nimport RELEASE_SYNC from \"#variants/release\"\nimport DEBUG_ASYNC from \"#variants/debug-asyncify\"\nimport RELEASE_ASYNC from \"#variants/release-asyncify\"\n\n/**\n * Create a new, completely isolated WebAssembly module containing the QuickJS library.\n * See the documentation on {@link QuickJSWASMModule}.\n *\n * Note that there is a hard limit on the number of WebAssembly modules in older\n * versions of v8:\n * https://bugs.chromium.org/p/v8/issues/detail?id=12076\n */\nexport async function newQuickJSWASMModule(\n /**\n * Optionally, pass a {@link QuickJSSyncVariant} to construct a different WebAssembly module.\n */\n variant: QuickJSSyncVariant = RELEASE_SYNC,\n): Promise<QuickJSWASMModule> {\n return newQuickJSWASMModuleFromVariant(variant)\n}\n\n/**\n * Create a new, completely isolated WebAssembly module containing a version of the QuickJS library\n * compiled with Emscripten's [ASYNCIFY](https://emscripten.org/docs/porting/asyncify.html) transform.\n *\n * This version of the library offers features that enable synchronous code\n * inside the VM to interact with asynchronous code in the host environment.\n * See the documentation on {@link QuickJSAsyncWASMModule}, {@link QuickJSAsyncRuntime},\n * and {@link QuickJSAsyncContext}.\n *\n * Note that there is a hard limit on the number of WebAssembly modules in older\n * versions of v8:\n * https://bugs.chromium.org/p/v8/issues/detail?id=12076\n */\nexport async function newQuickJSAsyncWASMModule(\n /**\n * Optionally, pass a {@link QuickJSAsyncVariant} to construct a different WebAssembly module.\n */\n variant: QuickJSAsyncVariant = RELEASE_ASYNC,\n): Promise<QuickJSAsyncWASMModule> {\n return newQuickJSAsyncWASMModuleFromVariant(variant)\n}\n\nexport { DEBUG_SYNC, RELEASE_SYNC, DEBUG_ASYNC, RELEASE_ASYNC }\n"],"mappings":"AAAA,OAGE,mCAAAA,EACA,wCAAAC,MAGK,0BACP,OAAOC,MAAgB,kBACvB,OAAOC,MAAkB,oBACzB,OAAOC,MAAiB,2BACxB,OAAOC,MAAmB,6BAU1B,eAAsBC,EAIpBC,EAA8BJ,EACF,CAC5B,OAAOH,EAAgCO,CAAO,CAChD,CAeA,eAAsBC,EAIpBD,EAA+BF,EACE,CACjC,OAAOJ,EAAqCM,CAAO,CACrD","names":["newQuickJSWASMModuleFromVariant","newQuickJSAsyncWASMModuleFromVariant","DEBUG_SYNC","RELEASE_SYNC","DEBUG_ASYNC","RELEASE_ASYNC","newQuickJSWASMModule","variant","newQuickJSAsyncWASMModule"]}
+1
-98

@@ -1,99 +0,2 @@

"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/index.ts
var src_exports = {};
__export(src_exports, {
DEBUG_ASYNC: () => import_debug_asyncify.default,
DEBUG_SYNC: () => import_debug.default,
RELEASE_ASYNC: () => import_release_asyncify.default,
RELEASE_SYNC: () => import_release.default,
getQuickJS: () => getQuickJS,
getQuickJSSync: () => getQuickJSSync,
newAsyncContext: () => newAsyncContext,
newAsyncRuntime: () => newAsyncRuntime,
newQuickJSAsyncWASMModule: () => newQuickJSAsyncWASMModule,
newQuickJSWASMModule: () => newQuickJSWASMModule
});
module.exports = __toCommonJS(src_exports);
__reExport(src_exports, require("quickjs-emscripten-core"), module.exports);
// src/variants.ts
var import_quickjs_emscripten_core = require("quickjs-emscripten-core");
var import_debug = __toESM(require("#variants/debug"));
var import_release = __toESM(require("#variants/release"));
var import_debug_asyncify = __toESM(require("#variants/debug-asyncify"));
var import_release_asyncify = __toESM(require("#variants/release-asyncify"));
async function newQuickJSWASMModule(variant = import_release.default) {
return (0, import_quickjs_emscripten_core.newQuickJSWASMModuleFromVariant)(variant);
}
async function newQuickJSAsyncWASMModule(variant = import_release_asyncify.default) {
return (0, import_quickjs_emscripten_core.newQuickJSAsyncWASMModuleFromVariant)(variant);
}
// src/mod.ts
var singleton = void 0;
var singletonPromise = void 0;
async function getQuickJS() {
singletonPromise ?? (singletonPromise = newQuickJSWASMModule().then((instance) => {
singleton = instance;
return instance;
}));
return await singletonPromise;
}
function getQuickJSSync() {
if (!singleton) {
throw new Error("QuickJS not initialized. Await getQuickJS() at least once.");
}
return singleton;
}
async function newAsyncRuntime(options) {
const module2 = await newQuickJSAsyncWASMModule();
return module2.newRuntime(options);
}
async function newAsyncContext(options) {
const module2 = await newQuickJSAsyncWASMModule();
return module2.newContext(options);
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
DEBUG_ASYNC,
DEBUG_SYNC,
RELEASE_ASYNC,
RELEASE_SYNC,
getQuickJS,
getQuickJSSync,
newAsyncContext,
newAsyncRuntime,
newQuickJSAsyncWASMModule,
newQuickJSWASMModule,
...require("quickjs-emscripten-core")
});
"use strict";var y=Object.create;var c=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var w=Object.getPrototypeOf,x=Object.prototype.hasOwnProperty;var W=(n,e)=>{for(var o in e)c(n,o,{get:e[o],enumerable:!0})},r=(n,e,o,J)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of p(e))!x.call(n,t)&&t!==o&&c(n,t,{get:()=>e[t],enumerable:!(J=f(e,t))||J.enumerable});return n},u=(n,e,o)=>(r(n,e,"default"),o&&r(o,e,"default")),S=(n,e,o)=>(o=n!=null?y(w(n)):{},r(e||!n||!n.__esModule?c(o,"default",{value:n,enumerable:!0}):o,n)),C=n=>r(c({},"__esModule",{value:!0}),n);var i={};W(i,{DEBUG_ASYNC:()=>a.default,DEBUG_SYNC:()=>Q.default,RELEASE_ASYNC:()=>M.default,RELEASE_SYNC:()=>A.default,getQuickJS:()=>E,getQuickJSSync:()=>R,newAsyncContext:()=>V,newAsyncRuntime:()=>P,newQuickJSAsyncWASMModule:()=>s,newQuickJSWASMModule:()=>d});module.exports=C(i);u(i,require("quickjs-emscripten-core"),module.exports);var m=require("quickjs-emscripten-core"),Q=S(require("#variants/debug")),A=S(require("#variants/release")),a=S(require("#variants/debug-asyncify")),M=S(require("#variants/release-asyncify"));async function d(n=A.default){return(0,m.newQuickJSWASMModuleFromVariant)(n)}async function s(n=M.default){return(0,m.newQuickJSAsyncWASMModuleFromVariant)(n)}var k,l;async function E(){return l??(l=d().then(n=>(k=n,n))),await l}function R(){if(!k)throw new Error("QuickJS not initialized. Await getQuickJS() at least once.");return k}async function P(n){return(await s()).newRuntime(n)}async function V(n){return(await s()).newContext(n)}0&&(module.exports={DEBUG_ASYNC,DEBUG_SYNC,RELEASE_ASYNC,RELEASE_SYNC,getQuickJS,getQuickJSSync,newAsyncContext,newAsyncRuntime,newQuickJSAsyncWASMModule,newQuickJSWASMModule,...require("quickjs-emscripten-core")});
//# sourceMappingURL=index.js.map

@@ -1,1 +0,1 @@

{"version":3,"sources":["../src/index.ts","../src/variants.ts","../src/mod.ts"],"sourcesContent":["export * from \"quickjs-emscripten-core\"\nexport * from \"./variants.js\"\nexport * from \"./mod.js\"\n","import {\n QuickJSSyncVariant,\n QuickJSAsyncVariant,\n newQuickJSWASMModuleFromVariant,\n newQuickJSAsyncWASMModuleFromVariant,\n QuickJSWASMModule,\n QuickJSAsyncWASMModule,\n} from \"quickjs-emscripten-core\"\nimport DEBUG_SYNC from \"#variants/debug\"\nimport RELEASE_SYNC from \"#variants/release\"\nimport DEBUG_ASYNC from \"#variants/debug-asyncify\"\nimport RELEASE_ASYNC from \"#variants/release-asyncify\"\n\n/**\n * Create a new, completely isolated WebAssembly module containing the QuickJS library.\n * See the documentation on {@link QuickJSWASMModule}.\n *\n * Note that there is a hard limit on the number of WebAssembly modules in older\n * versions of v8:\n * https://bugs.chromium.org/p/v8/issues/detail?id=12076\n */\nexport async function newQuickJSWASMModule(\n /**\n * Optionally, pass a {@link QuickJSSyncVariant} to construct a different WebAssembly module.\n */\n variant: QuickJSSyncVariant = RELEASE_SYNC,\n): Promise<QuickJSWASMModule> {\n return newQuickJSWASMModuleFromVariant(variant)\n}\n\n/**\n * Create a new, completely isolated WebAssembly module containing a version of the QuickJS library\n * compiled with Emscripten's [ASYNCIFY](https://emscripten.org/docs/porting/asyncify.html) transform.\n *\n * This version of the library offers features that enable synchronous code\n * inside the VM to interact with asynchronous code in the host environment.\n * See the documentation on {@link QuickJSAsyncWASMModule}, {@link QuickJSAsyncRuntime},\n * and {@link QuickJSAsyncContext}.\n *\n * Note that there is a hard limit on the number of WebAssembly modules in older\n * versions of v8:\n * https://bugs.chromium.org/p/v8/issues/detail?id=12076\n */\nexport async function newQuickJSAsyncWASMModule(\n /**\n * Optionally, pass a {@link QuickJSAsyncVariant} to construct a different WebAssembly module.\n */\n variant: QuickJSAsyncVariant = RELEASE_ASYNC,\n): Promise<QuickJSAsyncWASMModule> {\n return newQuickJSAsyncWASMModuleFromVariant(variant)\n}\n\nexport { DEBUG_SYNC, RELEASE_SYNC, DEBUG_ASYNC, RELEASE_ASYNC }\n","import {\n AsyncRuntimeOptions,\n ContextOptions,\n QuickJSAsyncContext,\n QuickJSAsyncRuntime,\n QuickJSWASMModule,\n} from \"quickjs-emscripten-core\"\nimport { newQuickJSAsyncWASMModule, newQuickJSWASMModule } from \"./variants\"\n\nlet singleton: QuickJSWASMModule | undefined = undefined\nlet singletonPromise: Promise<QuickJSWASMModule> | undefined = undefined\n\n/**\n * Get a shared singleton {@link QuickJSWASMModule}. Use this to evaluate code\n * or create Javascript environments.\n *\n * This is the top-level entrypoint for the quickjs-emscripten library.\n *\n * If you need strictest possible isolation guarantees, you may create a\n * separate {@link QuickJSWASMModule} via {@link newQuickJSWASMModule}.\n *\n * To work with the asyncified version of this library, see these functions:\n *\n * - {@link newAsyncRuntime}.\n * - {@link newAsyncContext}.\n * - {@link newQuickJSAsyncWASMModule}.\n */\nexport async function getQuickJS(): Promise<QuickJSWASMModule> {\n singletonPromise ??= newQuickJSWASMModule().then((instance) => {\n singleton = instance\n return instance\n })\n return await singletonPromise\n}\n\n/**\n * Provides synchronous access to the shared {@link QuickJSWASMModule} instance returned by {@link getQuickJS}, as long as\n * least once.\n * @throws If called before `getQuickJS` resolves.\n */\nexport function getQuickJSSync(): QuickJSWASMModule {\n if (!singleton) {\n throw new Error(\"QuickJS not initialized. Await getQuickJS() at least once.\")\n }\n return singleton\n}\n\n/**\n * Create a new {@link QuickJSAsyncRuntime} in a separate WebAssembly module.\n *\n * Each runtime is isolated in a separate WebAssembly module, so that errors in\n * one runtime cannot contaminate another runtime, and each runtime can execute\n * an asynchronous action without conflicts.\n *\n * Note that there is a hard limit on the number of WebAssembly modules in older\n * versions of v8:\n * https://bugs.chromium.org/p/v8/issues/detail?id=12076\n */\nexport async function newAsyncRuntime(options?: AsyncRuntimeOptions): Promise<QuickJSAsyncRuntime> {\n const module = await newQuickJSAsyncWASMModule()\n return module.newRuntime(options)\n}\n\n/**\n * Create a new {@link QuickJSAsyncContext} (with an associated runtime) in an\n * separate WebAssembly module.\n *\n * Each context is isolated in a separate WebAssembly module, so that errors in\n * one runtime cannot contaminate another runtime, and each runtime can execute\n * an asynchronous action without conflicts.\n *\n * Note that there is a hard limit on the number of WebAssembly modules in older\n * versions of v8:\n * https://bugs.chromium.org/p/v8/issues/detail?id=12076\n */\nexport async function newAsyncContext(options?: ContextOptions): Promise<QuickJSAsyncContext> {\n const module = await newQuickJSAsyncWASMModule()\n return module.newContext(options)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,2CAAAA;AAAA,EAAA,+BAAAC;AAAA,EAAA,6CAAAC;AAAA,EAAA,mCAAAC;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAc,oCAAd;;;ACAA,qCAOO;AACP,mBAAuB;AACvB,qBAAyB;AACzB,4BAAwB;AACxB,8BAA0B;AAU1B,eAAsB,qBAIpB,UAA8B,eAAAC,SACF;AAC5B,aAAO,gEAAgC,OAAO;AAChD;AAeA,eAAsB,0BAIpB,UAA+B,wBAAAC,SACE;AACjC,aAAO,qEAAqC,OAAO;AACrD;;;ACzCA,IAAI,YAA2C;AAC/C,IAAI,mBAA2D;AAiB/D,eAAsB,aAAyC;AAC7D,0CAAqB,qBAAqB,EAAE,KAAK,CAAC,aAAa;AAC7D,gBAAY;AACZ,WAAO;AAAA,EACT,CAAC;AACD,SAAO,MAAM;AACf;AAOO,SAAS,iBAAoC;AAClD,MAAI,CAAC,WAAW;AACd,UAAM,IAAI,MAAM,4DAA4D;AAAA,EAC9E;AACA,SAAO;AACT;AAaA,eAAsB,gBAAgB,SAA6D;AACjG,QAAMC,UAAS,MAAM,0BAA0B;AAC/C,SAAOA,QAAO,WAAW,OAAO;AAClC;AAcA,eAAsB,gBAAgB,SAAwD;AAC5F,QAAMA,UAAS,MAAM,0BAA0B;AAC/C,SAAOA,QAAO,WAAW,OAAO;AAClC;","names":["DEBUG_ASYNC","DEBUG_SYNC","RELEASE_ASYNC","RELEASE_SYNC","RELEASE_SYNC","RELEASE_ASYNC","module"]}
{"version":3,"sources":["../src/index.ts","../src/variants.ts","../src/mod.ts"],"sourcesContent":["export * from \"quickjs-emscripten-core\"\nexport * from \"./variants.js\"\nexport * from \"./mod.js\"\n","import {\n QuickJSSyncVariant,\n QuickJSAsyncVariant,\n newQuickJSWASMModuleFromVariant,\n newQuickJSAsyncWASMModuleFromVariant,\n QuickJSWASMModule,\n QuickJSAsyncWASMModule,\n} from \"quickjs-emscripten-core\"\nimport DEBUG_SYNC from \"#variants/debug\"\nimport RELEASE_SYNC from \"#variants/release\"\nimport DEBUG_ASYNC from \"#variants/debug-asyncify\"\nimport RELEASE_ASYNC from \"#variants/release-asyncify\"\n\n/**\n * Create a new, completely isolated WebAssembly module containing the QuickJS library.\n * See the documentation on {@link QuickJSWASMModule}.\n *\n * Note that there is a hard limit on the number of WebAssembly modules in older\n * versions of v8:\n * https://bugs.chromium.org/p/v8/issues/detail?id=12076\n */\nexport async function newQuickJSWASMModule(\n /**\n * Optionally, pass a {@link QuickJSSyncVariant} to construct a different WebAssembly module.\n */\n variant: QuickJSSyncVariant = RELEASE_SYNC,\n): Promise<QuickJSWASMModule> {\n return newQuickJSWASMModuleFromVariant(variant)\n}\n\n/**\n * Create a new, completely isolated WebAssembly module containing a version of the QuickJS library\n * compiled with Emscripten's [ASYNCIFY](https://emscripten.org/docs/porting/asyncify.html) transform.\n *\n * This version of the library offers features that enable synchronous code\n * inside the VM to interact with asynchronous code in the host environment.\n * See the documentation on {@link QuickJSAsyncWASMModule}, {@link QuickJSAsyncRuntime},\n * and {@link QuickJSAsyncContext}.\n *\n * Note that there is a hard limit on the number of WebAssembly modules in older\n * versions of v8:\n * https://bugs.chromium.org/p/v8/issues/detail?id=12076\n */\nexport async function newQuickJSAsyncWASMModule(\n /**\n * Optionally, pass a {@link QuickJSAsyncVariant} to construct a different WebAssembly module.\n */\n variant: QuickJSAsyncVariant = RELEASE_ASYNC,\n): Promise<QuickJSAsyncWASMModule> {\n return newQuickJSAsyncWASMModuleFromVariant(variant)\n}\n\nexport { DEBUG_SYNC, RELEASE_SYNC, DEBUG_ASYNC, RELEASE_ASYNC }\n","import {\n AsyncRuntimeOptions,\n ContextOptions,\n QuickJSAsyncContext,\n QuickJSAsyncRuntime,\n QuickJSWASMModule,\n} from \"quickjs-emscripten-core\"\nimport { newQuickJSAsyncWASMModule, newQuickJSWASMModule } from \"./variants\"\n\nlet singleton: QuickJSWASMModule | undefined = undefined\nlet singletonPromise: Promise<QuickJSWASMModule> | undefined = undefined\n\n/**\n * Get a shared singleton {@link QuickJSWASMModule}. Use this to evaluate code\n * or create Javascript environments.\n *\n * This is the top-level entrypoint for the quickjs-emscripten library.\n *\n * If you need strictest possible isolation guarantees, you may create a\n * separate {@link QuickJSWASMModule} via {@link newQuickJSWASMModule}.\n *\n * To work with the asyncified version of this library, see these functions:\n *\n * - {@link newAsyncRuntime}.\n * - {@link newAsyncContext}.\n * - {@link newQuickJSAsyncWASMModule}.\n */\nexport async function getQuickJS(): Promise<QuickJSWASMModule> {\n singletonPromise ??= newQuickJSWASMModule().then((instance) => {\n singleton = instance\n return instance\n })\n return await singletonPromise\n}\n\n/**\n * Provides synchronous access to the shared {@link QuickJSWASMModule} instance returned by {@link getQuickJS}, as long as\n * least once.\n * @throws If called before `getQuickJS` resolves.\n */\nexport function getQuickJSSync(): QuickJSWASMModule {\n if (!singleton) {\n throw new Error(\"QuickJS not initialized. Await getQuickJS() at least once.\")\n }\n return singleton\n}\n\n/**\n * Create a new {@link QuickJSAsyncRuntime} in a separate WebAssembly module.\n *\n * Each runtime is isolated in a separate WebAssembly module, so that errors in\n * one runtime cannot contaminate another runtime, and each runtime can execute\n * an asynchronous action without conflicts.\n *\n * Note that there is a hard limit on the number of WebAssembly modules in older\n * versions of v8:\n * https://bugs.chromium.org/p/v8/issues/detail?id=12076\n */\nexport async function newAsyncRuntime(options?: AsyncRuntimeOptions): Promise<QuickJSAsyncRuntime> {\n const module = await newQuickJSAsyncWASMModule()\n return module.newRuntime(options)\n}\n\n/**\n * Create a new {@link QuickJSAsyncContext} (with an associated runtime) in an\n * separate WebAssembly module.\n *\n * Each context is isolated in a separate WebAssembly module, so that errors in\n * one runtime cannot contaminate another runtime, and each runtime can execute\n * an asynchronous action without conflicts.\n *\n * Note that there is a hard limit on the number of WebAssembly modules in older\n * versions of v8:\n * https://bugs.chromium.org/p/v8/issues/detail?id=12076\n */\nexport async function newAsyncContext(options?: ContextOptions): Promise<QuickJSAsyncContext> {\n const module = await newQuickJSAsyncWASMModule()\n return module.newContext(options)\n}\n"],"mappings":"wmBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,mBAAAE,QAAA,iBAAAC,QAAA,oBAAAC,QAAA,mBAAAC,QAAA,eAAAC,EAAA,mBAAAC,EAAA,oBAAAC,EAAA,oBAAAC,EAAA,8BAAAC,EAAA,yBAAAC,IAAA,eAAAC,EAAAZ,GAAAa,EAAAb,EAAc,mCAAd,gBCAA,IAAAc,EAOO,mCACPC,EAAuB,8BACvBC,EAAyB,gCACzBC,EAAwB,uCACxBC,EAA0B,yCAU1B,eAAsBC,EAIpBC,EAA8B,EAAAC,QACF,CAC5B,SAAO,mCAAgCD,CAAO,CAChD,CAeA,eAAsBE,EAIpBF,EAA+B,EAAAG,QACE,CACjC,SAAO,wCAAqCH,CAAO,CACrD,CCzCA,IAAII,EACAC,EAiBJ,eAAsBC,GAAyC,CAC7D,OAAAD,MAAqBE,EAAqB,EAAE,KAAMC,IAChDJ,EAAYI,EACLA,EACR,GACM,MAAMH,CACf,CAOO,SAASI,GAAoC,CAClD,GAAI,CAACL,EACH,MAAM,IAAI,MAAM,4DAA4D,EAE9E,OAAOA,CACT,CAaA,eAAsBM,EAAgBC,EAA6D,CAEjG,OADe,MAAMC,EAA0B,GACjC,WAAWD,CAAO,CAClC,CAcA,eAAsBE,EAAgBF,EAAwD,CAE5F,OADe,MAAMC,EAA0B,GACjC,WAAWD,CAAO,CAClC","names":["src_exports","__export","DEBUG_ASYNC","DEBUG_SYNC","RELEASE_ASYNC","RELEASE_SYNC","getQuickJS","getQuickJSSync","newAsyncContext","newAsyncRuntime","newQuickJSAsyncWASMModule","newQuickJSWASMModule","__toCommonJS","__reExport","import_quickjs_emscripten_core","import_debug","import_release","import_debug_asyncify","import_release_asyncify","newQuickJSWASMModule","variant","RELEASE_SYNC","newQuickJSAsyncWASMModule","RELEASE_ASYNC","singleton","singletonPromise","getQuickJS","newQuickJSWASMModule","instance","getQuickJSSync","newAsyncRuntime","options","newQuickJSAsyncWASMModule","newAsyncContext"]}

@@ -1,49 +0,2 @@

import {
DEBUG_ASYNC,
DEBUG_SYNC,
RELEASE_ASYNC,
RELEASE_SYNC,
newQuickJSAsyncWASMModule,
newQuickJSWASMModule
} from "./chunk-F5EB3F4Q.mjs";
// src/index.ts
export * from "quickjs-emscripten-core";
// src/mod.ts
var singleton = void 0;
var singletonPromise = void 0;
async function getQuickJS() {
singletonPromise ?? (singletonPromise = newQuickJSWASMModule().then((instance) => {
singleton = instance;
return instance;
}));
return await singletonPromise;
}
function getQuickJSSync() {
if (!singleton) {
throw new Error("QuickJS not initialized. Await getQuickJS() at least once.");
}
return singleton;
}
async function newAsyncRuntime(options) {
const module = await newQuickJSAsyncWASMModule();
return module.newRuntime(options);
}
async function newAsyncContext(options) {
const module = await newQuickJSAsyncWASMModule();
return module.newContext(options);
}
export {
DEBUG_ASYNC,
DEBUG_SYNC,
RELEASE_ASYNC,
RELEASE_SYNC,
getQuickJS,
getQuickJSSync,
newAsyncContext,
newAsyncRuntime,
newQuickJSAsyncWASMModule,
newQuickJSWASMModule
};
import{a as c,b as r,c as s,d as S,e as o,f as n}from"./chunk-4PPVDWQ2.mjs";export*from"quickjs-emscripten-core";var t,i;async function d(){return i??(i=o().then(e=>(t=e,e))),await i}function l(){if(!t)throw new Error("QuickJS not initialized. Await getQuickJS() at least once.");return t}async function A(e){return(await n()).newRuntime(e)}async function k(e){return(await n()).newContext(e)}export{s as DEBUG_ASYNC,c as DEBUG_SYNC,S as RELEASE_ASYNC,r as RELEASE_SYNC,d as getQuickJS,l as getQuickJSSync,k as newAsyncContext,A as newAsyncRuntime,n as newQuickJSAsyncWASMModule,o as newQuickJSWASMModule};
//# sourceMappingURL=index.mjs.map

@@ -1,1 +0,1 @@

{"version":3,"sources":["../src/index.ts","../src/mod.ts"],"sourcesContent":["export * from \"quickjs-emscripten-core\"\nexport * from \"./variants.js\"\nexport * from \"./mod.js\"\n","import {\n AsyncRuntimeOptions,\n ContextOptions,\n QuickJSAsyncContext,\n QuickJSAsyncRuntime,\n QuickJSWASMModule,\n} from \"quickjs-emscripten-core\"\nimport { newQuickJSAsyncWASMModule, newQuickJSWASMModule } from \"./variants\"\n\nlet singleton: QuickJSWASMModule | undefined = undefined\nlet singletonPromise: Promise<QuickJSWASMModule> | undefined = undefined\n\n/**\n * Get a shared singleton {@link QuickJSWASMModule}. Use this to evaluate code\n * or create Javascript environments.\n *\n * This is the top-level entrypoint for the quickjs-emscripten library.\n *\n * If you need strictest possible isolation guarantees, you may create a\n * separate {@link QuickJSWASMModule} via {@link newQuickJSWASMModule}.\n *\n * To work with the asyncified version of this library, see these functions:\n *\n * - {@link newAsyncRuntime}.\n * - {@link newAsyncContext}.\n * - {@link newQuickJSAsyncWASMModule}.\n */\nexport async function getQuickJS(): Promise<QuickJSWASMModule> {\n singletonPromise ??= newQuickJSWASMModule().then((instance) => {\n singleton = instance\n return instance\n })\n return await singletonPromise\n}\n\n/**\n * Provides synchronous access to the shared {@link QuickJSWASMModule} instance returned by {@link getQuickJS}, as long as\n * least once.\n * @throws If called before `getQuickJS` resolves.\n */\nexport function getQuickJSSync(): QuickJSWASMModule {\n if (!singleton) {\n throw new Error(\"QuickJS not initialized. Await getQuickJS() at least once.\")\n }\n return singleton\n}\n\n/**\n * Create a new {@link QuickJSAsyncRuntime} in a separate WebAssembly module.\n *\n * Each runtime is isolated in a separate WebAssembly module, so that errors in\n * one runtime cannot contaminate another runtime, and each runtime can execute\n * an asynchronous action without conflicts.\n *\n * Note that there is a hard limit on the number of WebAssembly modules in older\n * versions of v8:\n * https://bugs.chromium.org/p/v8/issues/detail?id=12076\n */\nexport async function newAsyncRuntime(options?: AsyncRuntimeOptions): Promise<QuickJSAsyncRuntime> {\n const module = await newQuickJSAsyncWASMModule()\n return module.newRuntime(options)\n}\n\n/**\n * Create a new {@link QuickJSAsyncContext} (with an associated runtime) in an\n * separate WebAssembly module.\n *\n * Each context is isolated in a separate WebAssembly module, so that errors in\n * one runtime cannot contaminate another runtime, and each runtime can execute\n * an asynchronous action without conflicts.\n *\n * Note that there is a hard limit on the number of WebAssembly modules in older\n * versions of v8:\n * https://bugs.chromium.org/p/v8/issues/detail?id=12076\n */\nexport async function newAsyncContext(options?: ContextOptions): Promise<QuickJSAsyncContext> {\n const module = await newQuickJSAsyncWASMModule()\n return module.newContext(options)\n}\n"],"mappings":";;;;;;;;;;AAAA,cAAc;;;ACSd,IAAI,YAA2C;AAC/C,IAAI,mBAA2D;AAiB/D,eAAsB,aAAyC;AAC7D,0CAAqB,qBAAqB,EAAE,KAAK,CAAC,aAAa;AAC7D,gBAAY;AACZ,WAAO;AAAA,EACT,CAAC;AACD,SAAO,MAAM;AACf;AAOO,SAAS,iBAAoC;AAClD,MAAI,CAAC,WAAW;AACd,UAAM,IAAI,MAAM,4DAA4D;AAAA,EAC9E;AACA,SAAO;AACT;AAaA,eAAsB,gBAAgB,SAA6D;AACjG,QAAM,SAAS,MAAM,0BAA0B;AAC/C,SAAO,OAAO,WAAW,OAAO;AAClC;AAcA,eAAsB,gBAAgB,SAAwD;AAC5F,QAAM,SAAS,MAAM,0BAA0B;AAC/C,SAAO,OAAO,WAAW,OAAO;AAClC;","names":[]}
{"version":3,"sources":["../src/index.ts","../src/mod.ts"],"sourcesContent":["export * from \"quickjs-emscripten-core\"\nexport * from \"./variants.js\"\nexport * from \"./mod.js\"\n","import {\n AsyncRuntimeOptions,\n ContextOptions,\n QuickJSAsyncContext,\n QuickJSAsyncRuntime,\n QuickJSWASMModule,\n} from \"quickjs-emscripten-core\"\nimport { newQuickJSAsyncWASMModule, newQuickJSWASMModule } from \"./variants\"\n\nlet singleton: QuickJSWASMModule | undefined = undefined\nlet singletonPromise: Promise<QuickJSWASMModule> | undefined = undefined\n\n/**\n * Get a shared singleton {@link QuickJSWASMModule}. Use this to evaluate code\n * or create Javascript environments.\n *\n * This is the top-level entrypoint for the quickjs-emscripten library.\n *\n * If you need strictest possible isolation guarantees, you may create a\n * separate {@link QuickJSWASMModule} via {@link newQuickJSWASMModule}.\n *\n * To work with the asyncified version of this library, see these functions:\n *\n * - {@link newAsyncRuntime}.\n * - {@link newAsyncContext}.\n * - {@link newQuickJSAsyncWASMModule}.\n */\nexport async function getQuickJS(): Promise<QuickJSWASMModule> {\n singletonPromise ??= newQuickJSWASMModule().then((instance) => {\n singleton = instance\n return instance\n })\n return await singletonPromise\n}\n\n/**\n * Provides synchronous access to the shared {@link QuickJSWASMModule} instance returned by {@link getQuickJS}, as long as\n * least once.\n * @throws If called before `getQuickJS` resolves.\n */\nexport function getQuickJSSync(): QuickJSWASMModule {\n if (!singleton) {\n throw new Error(\"QuickJS not initialized. Await getQuickJS() at least once.\")\n }\n return singleton\n}\n\n/**\n * Create a new {@link QuickJSAsyncRuntime} in a separate WebAssembly module.\n *\n * Each runtime is isolated in a separate WebAssembly module, so that errors in\n * one runtime cannot contaminate another runtime, and each runtime can execute\n * an asynchronous action without conflicts.\n *\n * Note that there is a hard limit on the number of WebAssembly modules in older\n * versions of v8:\n * https://bugs.chromium.org/p/v8/issues/detail?id=12076\n */\nexport async function newAsyncRuntime(options?: AsyncRuntimeOptions): Promise<QuickJSAsyncRuntime> {\n const module = await newQuickJSAsyncWASMModule()\n return module.newRuntime(options)\n}\n\n/**\n * Create a new {@link QuickJSAsyncContext} (with an associated runtime) in an\n * separate WebAssembly module.\n *\n * Each context is isolated in a separate WebAssembly module, so that errors in\n * one runtime cannot contaminate another runtime, and each runtime can execute\n * an asynchronous action without conflicts.\n *\n * Note that there is a hard limit on the number of WebAssembly modules in older\n * versions of v8:\n * https://bugs.chromium.org/p/v8/issues/detail?id=12076\n */\nexport async function newAsyncContext(options?: ContextOptions): Promise<QuickJSAsyncContext> {\n const module = await newQuickJSAsyncWASMModule()\n return module.newContext(options)\n}\n"],"mappings":"4EAAA,WAAc,0BCSd,IAAIA,EACAC,EAiBJ,eAAsBC,GAAyC,CAC7D,OAAAD,MAAqBE,EAAqB,EAAE,KAAMC,IAChDJ,EAAYI,EACLA,EACR,GACM,MAAMH,CACf,CAOO,SAASI,GAAoC,CAClD,GAAI,CAACL,EACH,MAAM,IAAI,MAAM,4DAA4D,EAE9E,OAAOA,CACT,CAaA,eAAsBM,EAAgBC,EAA6D,CAEjG,OADe,MAAMC,EAA0B,GACjC,WAAWD,CAAO,CAClC,CAcA,eAAsBE,EAAgBF,EAAwD,CAE5F,OADe,MAAMC,EAA0B,GACjC,WAAWD,CAAO,CAClC","names":["singleton","singletonPromise","getQuickJS","newQuickJSWASMModule","instance","getQuickJSSync","newAsyncRuntime","options","newQuickJSAsyncWASMModule","newAsyncContext"]}

@@ -1,61 +0,2 @@

"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/variants.ts
var variants_exports = {};
__export(variants_exports, {
DEBUG_ASYNC: () => import_debug_asyncify.default,
DEBUG_SYNC: () => import_debug.default,
RELEASE_ASYNC: () => import_release_asyncify.default,
RELEASE_SYNC: () => import_release.default,
newQuickJSAsyncWASMModule: () => newQuickJSAsyncWASMModule,
newQuickJSWASMModule: () => newQuickJSWASMModule
});
module.exports = __toCommonJS(variants_exports);
var import_quickjs_emscripten_core = require("quickjs-emscripten-core");
var import_debug = __toESM(require("#variants/debug"));
var import_release = __toESM(require("#variants/release"));
var import_debug_asyncify = __toESM(require("#variants/debug-asyncify"));
var import_release_asyncify = __toESM(require("#variants/release-asyncify"));
async function newQuickJSWASMModule(variant = import_release.default) {
return (0, import_quickjs_emscripten_core.newQuickJSWASMModuleFromVariant)(variant);
}
async function newQuickJSAsyncWASMModule(variant = import_release_asyncify.default) {
return (0, import_quickjs_emscripten_core.newQuickJSAsyncWASMModuleFromVariant)(variant);
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
DEBUG_ASYNC,
DEBUG_SYNC,
RELEASE_ASYNC,
RELEASE_SYNC,
newQuickJSAsyncWASMModule,
newQuickJSWASMModule
});
"use strict";var k=Object.create;var n=Object.defineProperty;var J=Object.getOwnPropertyDescriptor;var Q=Object.getOwnPropertyNames;var s=Object.getPrototypeOf,y=Object.prototype.hasOwnProperty;var d=(S,i)=>{for(var o in i)n(S,o,{get:i[o],enumerable:!0})},M=(S,i,o,A)=>{if(i&&typeof i=="object"||typeof i=="function")for(let r of Q(i))!y.call(S,r)&&r!==o&&n(S,r,{get:()=>i[r],enumerable:!(A=J(i,r))||A.enumerable});return S};var c=(S,i,o)=>(o=S!=null?k(s(S)):{},M(i||!S||!S.__esModule?n(o,"default",{value:S,enumerable:!0}):o,S)),l=S=>M(n({},"__esModule",{value:!0}),S);var W={};d(W,{DEBUG_ASYNC:()=>m.default,DEBUG_SYNC:()=>a.default,RELEASE_ASYNC:()=>t.default,RELEASE_SYNC:()=>e.default,newQuickJSAsyncWASMModule:()=>E,newQuickJSWASMModule:()=>p});module.exports=l(W);var u=require("quickjs-emscripten-core"),a=c(require("#variants/debug")),e=c(require("#variants/release")),m=c(require("#variants/debug-asyncify")),t=c(require("#variants/release-asyncify"));async function p(S=e.default){return(0,u.newQuickJSWASMModuleFromVariant)(S)}async function E(S=t.default){return(0,u.newQuickJSAsyncWASMModuleFromVariant)(S)}0&&(module.exports={DEBUG_ASYNC,DEBUG_SYNC,RELEASE_ASYNC,RELEASE_SYNC,newQuickJSAsyncWASMModule,newQuickJSWASMModule});
//# sourceMappingURL=variants.js.map

@@ -1,1 +0,1 @@

{"version":3,"sources":["../src/variants.ts"],"sourcesContent":["import {\n QuickJSSyncVariant,\n QuickJSAsyncVariant,\n newQuickJSWASMModuleFromVariant,\n newQuickJSAsyncWASMModuleFromVariant,\n QuickJSWASMModule,\n QuickJSAsyncWASMModule,\n} from \"quickjs-emscripten-core\"\nimport DEBUG_SYNC from \"#variants/debug\"\nimport RELEASE_SYNC from \"#variants/release\"\nimport DEBUG_ASYNC from \"#variants/debug-asyncify\"\nimport RELEASE_ASYNC from \"#variants/release-asyncify\"\n\n/**\n * Create a new, completely isolated WebAssembly module containing the QuickJS library.\n * See the documentation on {@link QuickJSWASMModule}.\n *\n * Note that there is a hard limit on the number of WebAssembly modules in older\n * versions of v8:\n * https://bugs.chromium.org/p/v8/issues/detail?id=12076\n */\nexport async function newQuickJSWASMModule(\n /**\n * Optionally, pass a {@link QuickJSSyncVariant} to construct a different WebAssembly module.\n */\n variant: QuickJSSyncVariant = RELEASE_SYNC,\n): Promise<QuickJSWASMModule> {\n return newQuickJSWASMModuleFromVariant(variant)\n}\n\n/**\n * Create a new, completely isolated WebAssembly module containing a version of the QuickJS library\n * compiled with Emscripten's [ASYNCIFY](https://emscripten.org/docs/porting/asyncify.html) transform.\n *\n * This version of the library offers features that enable synchronous code\n * inside the VM to interact with asynchronous code in the host environment.\n * See the documentation on {@link QuickJSAsyncWASMModule}, {@link QuickJSAsyncRuntime},\n * and {@link QuickJSAsyncContext}.\n *\n * Note that there is a hard limit on the number of WebAssembly modules in older\n * versions of v8:\n * https://bugs.chromium.org/p/v8/issues/detail?id=12076\n */\nexport async function newQuickJSAsyncWASMModule(\n /**\n * Optionally, pass a {@link QuickJSAsyncVariant} to construct a different WebAssembly module.\n */\n variant: QuickJSAsyncVariant = RELEASE_ASYNC,\n): Promise<QuickJSAsyncWASMModule> {\n return newQuickJSAsyncWASMModuleFromVariant(variant)\n}\n\nexport { DEBUG_SYNC, RELEASE_SYNC, DEBUG_ASYNC, RELEASE_ASYNC }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,2CAAAA;AAAA,EAAA,+BAAAC;AAAA,EAAA,6CAAAC;AAAA,EAAA,mCAAAC;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA,qCAOO;AACP,mBAAuB;AACvB,qBAAyB;AACzB,4BAAwB;AACxB,8BAA0B;AAU1B,eAAsB,qBAIpB,UAA8B,eAAAA,SACF;AAC5B,aAAO,gEAAgC,OAAO;AAChD;AAeA,eAAsB,0BAIpB,UAA+B,wBAAAD,SACE;AACjC,aAAO,qEAAqC,OAAO;AACrD;","names":["DEBUG_ASYNC","DEBUG_SYNC","RELEASE_ASYNC","RELEASE_SYNC"]}
{"version":3,"sources":["../src/variants.ts"],"sourcesContent":["import {\n QuickJSSyncVariant,\n QuickJSAsyncVariant,\n newQuickJSWASMModuleFromVariant,\n newQuickJSAsyncWASMModuleFromVariant,\n QuickJSWASMModule,\n QuickJSAsyncWASMModule,\n} from \"quickjs-emscripten-core\"\nimport DEBUG_SYNC from \"#variants/debug\"\nimport RELEASE_SYNC from \"#variants/release\"\nimport DEBUG_ASYNC from \"#variants/debug-asyncify\"\nimport RELEASE_ASYNC from \"#variants/release-asyncify\"\n\n/**\n * Create a new, completely isolated WebAssembly module containing the QuickJS library.\n * See the documentation on {@link QuickJSWASMModule}.\n *\n * Note that there is a hard limit on the number of WebAssembly modules in older\n * versions of v8:\n * https://bugs.chromium.org/p/v8/issues/detail?id=12076\n */\nexport async function newQuickJSWASMModule(\n /**\n * Optionally, pass a {@link QuickJSSyncVariant} to construct a different WebAssembly module.\n */\n variant: QuickJSSyncVariant = RELEASE_SYNC,\n): Promise<QuickJSWASMModule> {\n return newQuickJSWASMModuleFromVariant(variant)\n}\n\n/**\n * Create a new, completely isolated WebAssembly module containing a version of the QuickJS library\n * compiled with Emscripten's [ASYNCIFY](https://emscripten.org/docs/porting/asyncify.html) transform.\n *\n * This version of the library offers features that enable synchronous code\n * inside the VM to interact with asynchronous code in the host environment.\n * See the documentation on {@link QuickJSAsyncWASMModule}, {@link QuickJSAsyncRuntime},\n * and {@link QuickJSAsyncContext}.\n *\n * Note that there is a hard limit on the number of WebAssembly modules in older\n * versions of v8:\n * https://bugs.chromium.org/p/v8/issues/detail?id=12076\n */\nexport async function newQuickJSAsyncWASMModule(\n /**\n * Optionally, pass a {@link QuickJSAsyncVariant} to construct a different WebAssembly module.\n */\n variant: QuickJSAsyncVariant = RELEASE_ASYNC,\n): Promise<QuickJSAsyncWASMModule> {\n return newQuickJSAsyncWASMModuleFromVariant(variant)\n}\n\nexport { DEBUG_SYNC, RELEASE_SYNC, DEBUG_ASYNC, RELEASE_ASYNC }\n"],"mappings":"0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,mBAAAE,QAAA,iBAAAC,QAAA,oBAAAC,QAAA,mBAAAC,QAAA,8BAAAC,EAAA,yBAAAC,IAAA,eAAAC,EAAAR,GAAA,IAAAS,EAOO,mCACPC,EAAuB,8BACvBC,EAAyB,gCACzBC,EAAwB,uCACxBC,EAA0B,yCAU1B,eAAsBN,EAIpBO,EAA8B,EAAAT,QACF,CAC5B,SAAO,mCAAgCS,CAAO,CAChD,CAeA,eAAsBR,EAIpBQ,EAA+B,EAAAV,QACE,CACjC,SAAO,wCAAqCU,CAAO,CACrD","names":["variants_exports","__export","DEBUG_ASYNC","DEBUG_SYNC","RELEASE_ASYNC","RELEASE_SYNC","newQuickJSAsyncWASMModule","newQuickJSWASMModule","__toCommonJS","import_quickjs_emscripten_core","import_debug","import_release","import_debug_asyncify","import_release_asyncify","variant"]}

@@ -1,17 +0,2 @@

import {
DEBUG_ASYNC,
DEBUG_SYNC,
RELEASE_ASYNC,
RELEASE_SYNC,
newQuickJSAsyncWASMModule,
newQuickJSWASMModule
} from "./chunk-F5EB3F4Q.mjs";
export {
DEBUG_ASYNC,
DEBUG_SYNC,
RELEASE_ASYNC,
RELEASE_SYNC,
newQuickJSAsyncWASMModule,
newQuickJSWASMModule
};
import{a,b,c,d,e,f}from"./chunk-4PPVDWQ2.mjs";export{c as DEBUG_ASYNC,a as DEBUG_SYNC,d as RELEASE_ASYNC,b as RELEASE_SYNC,f as newQuickJSAsyncWASMModule,e as newQuickJSWASMModule};
//# sourceMappingURL=variants.mjs.map
{
"name": "quickjs-emscripten",
"version": "0.25.0-rc.1",
"version": "0.25.0-rc.2",
"sideEffects": false,

@@ -78,15 +78,15 @@ "license": "MIT",

"dependencies": {
"@jitl/quickjs-browser-debug-asyncify-singlefile": "0.25.0-rc.1",
"@jitl/quickjs-browser-debug-sync-singlefile": "0.25.0-rc.1",
"@jitl/quickjs-browser-release-asyncify-singlefile": "0.25.0-rc.1",
"@jitl/quickjs-browser-release-sync-singlefile": "0.25.0-rc.1",
"@jitl/quickjs-node-cjs-debug-asyncify-wasm": "0.25.0-rc.1",
"@jitl/quickjs-node-cjs-debug-sync-wasm": "0.25.0-rc.1",
"@jitl/quickjs-node-cjs-release-asyncify-wasm": "0.25.0-rc.1",
"@jitl/quickjs-node-cjs-release-sync-wasm": "0.25.0-rc.1",
"@jitl/quickjs-node-esm-debug-asyncify-wasm": "0.25.0-rc.1",
"@jitl/quickjs-node-esm-debug-sync-wasm": "0.25.0-rc.1",
"@jitl/quickjs-node-esm-release-asyncify-wasm": "0.25.0-rc.1",
"@jitl/quickjs-node-esm-release-sync-wasm": "0.25.0-rc.1",
"quickjs-emscripten-core": "0.25.0-rc.1"
"@jitl/quickjs-browser-debug-asyncify-singlefile": "0.25.0-rc.2",
"@jitl/quickjs-browser-debug-sync-singlefile": "0.25.0-rc.2",
"@jitl/quickjs-browser-release-asyncify-singlefile": "0.25.0-rc.2",
"@jitl/quickjs-browser-release-sync-singlefile": "0.25.0-rc.2",
"@jitl/quickjs-node-cjs-debug-asyncify-wasm": "0.25.0-rc.2",
"@jitl/quickjs-node-cjs-debug-sync-wasm": "0.25.0-rc.2",
"@jitl/quickjs-node-cjs-release-asyncify-wasm": "0.25.0-rc.2",
"@jitl/quickjs-node-cjs-release-sync-wasm": "0.25.0-rc.2",
"@jitl/quickjs-node-esm-debug-asyncify-wasm": "0.25.0-rc.2",
"@jitl/quickjs-node-esm-debug-sync-wasm": "0.25.0-rc.2",
"@jitl/quickjs-node-esm-release-asyncify-wasm": "0.25.0-rc.2",
"@jitl/quickjs-node-esm-release-sync-wasm": "0.25.0-rc.2",
"quickjs-emscripten-core": "0.25.0-rc.2"
},

@@ -93,0 +93,0 @@ "engines": {

// src/variants.ts
import {
newQuickJSWASMModuleFromVariant,
newQuickJSAsyncWASMModuleFromVariant
} from "quickjs-emscripten-core";
import DEBUG_SYNC from "#variants/debug";
import RELEASE_SYNC from "#variants/release";
import DEBUG_ASYNC from "#variants/debug-asyncify";
import RELEASE_ASYNC from "#variants/release-asyncify";
async function newQuickJSWASMModule(variant = RELEASE_SYNC) {
return newQuickJSWASMModuleFromVariant(variant);
}
async function newQuickJSAsyncWASMModule(variant = RELEASE_ASYNC) {
return newQuickJSAsyncWASMModuleFromVariant(variant);
}
export {
DEBUG_SYNC,
RELEASE_SYNC,
DEBUG_ASYNC,
RELEASE_ASYNC,
newQuickJSWASMModule,
newQuickJSAsyncWASMModule
};
//# sourceMappingURL=chunk-EQBOUVYD.mjs.map
{"version":3,"sources":["../src/variants.ts"],"sourcesContent":["import {\n QuickJSSyncVariant,\n QuickJSAsyncVariant,\n newQuickJSWASMModuleFromVariant,\n newQuickJSAsyncWASMModuleFromVariant,\n QuickJSWASMModule,\n QuickJSAsyncWASMModule,\n} from \"quickjs-emscripten-core\"\nimport DEBUG_SYNC from \"#variants/debug\"\nimport RELEASE_SYNC from \"#variants/release\"\nimport DEBUG_ASYNC from \"#variants/debug-asyncify\"\nimport RELEASE_ASYNC from \"#variants/release-asyncify\"\n\n/**\n * Create a new, completely isolated WebAssembly module containing the QuickJS library.\n * See the documentation on [[QuickJSWASMModule]].\n *\n * Note that there is a hard limit on the number of WebAssembly modules in older\n * versions of v8:\n * https://bugs.chromium.org/p/v8/issues/detail?id=12076\n */\nexport async function newQuickJSWASMModule(\n /**\n * Optionally, pass a {@link SyncBuildVariant} to construct a different WebAssembly module.\n */\n variant: QuickJSSyncVariant = RELEASE_SYNC\n): Promise<QuickJSWASMModule> {\n return newQuickJSWASMModuleFromVariant(variant)\n}\n\n/**\n * Create a new, completely isolated WebAssembly module containing a version of the QuickJS library\n * compiled with Emscripten's [ASYNCIFY](https://emscripten.org/docs/porting/asyncify.html) transform.\n *\n * This version of the library offers features that enable synchronous code\n * inside the VM to interact with asynchronous code in the host environment.\n * See the documentation on [[QuickJSAsyncWASMModule]], [[QuickJSAsyncRuntime]],\n * and [[QuickJSAsyncContext]].\n *\n * Note that there is a hard limit on the number of WebAssembly modules in older\n * versions of v8:\n * https://bugs.chromium.org/p/v8/issues/detail?id=12076\n */\nexport async function newQuickJSAsyncWASMModule(\n /**\n * Optionally, pass a {@link AsyncBuildVariant} to construct a different WebAssembly module.\n */\n variant: QuickJSAsyncVariant = RELEASE_ASYNC\n): Promise<QuickJSAsyncWASMModule> {\n return newQuickJSAsyncWASMModuleFromVariant(variant)\n}\n\nexport { DEBUG_SYNC, RELEASE_SYNC, DEBUG_ASYNC, RELEASE_ASYNC }\n"],"mappings":";AAAA;AAAA,EAGE;AAAA,EACA;AAAA,OAGK;AACP,OAAO,gBAAgB;AACvB,OAAO,kBAAkB;AACzB,OAAO,iBAAiB;AACxB,OAAO,mBAAmB;AAU1B,eAAsB,qBAIpB,UAA8B,cACF;AAC5B,SAAO,gCAAgC,OAAO;AAChD;AAeA,eAAsB,0BAIpB,UAA+B,eACE;AACjC,SAAO,qCAAqC,OAAO;AACrD;","names":[]}
// src/variants.ts
import {
newQuickJSWASMModuleFromVariant,
newQuickJSAsyncWASMModuleFromVariant
} from "quickjs-emscripten-core";
import DEBUG_SYNC from "#variants/debug";
import RELEASE_SYNC from "#variants/release";
import DEBUG_ASYNC from "#variants/debug-asyncify";
import RELEASE_ASYNC from "#variants/release-asyncify";
async function newQuickJSWASMModule(variant = RELEASE_SYNC) {
return newQuickJSWASMModuleFromVariant(variant);
}
async function newQuickJSAsyncWASMModule(variant = RELEASE_ASYNC) {
return newQuickJSAsyncWASMModuleFromVariant(variant);
}
export {
DEBUG_SYNC,
RELEASE_SYNC,
DEBUG_ASYNC,
RELEASE_ASYNC,
newQuickJSWASMModule,
newQuickJSAsyncWASMModule
};
//# sourceMappingURL=chunk-F5EB3F4Q.mjs.map
{"version":3,"sources":["../src/variants.ts"],"sourcesContent":["import {\n QuickJSSyncVariant,\n QuickJSAsyncVariant,\n newQuickJSWASMModuleFromVariant,\n newQuickJSAsyncWASMModuleFromVariant,\n QuickJSWASMModule,\n QuickJSAsyncWASMModule,\n} from \"quickjs-emscripten-core\"\nimport DEBUG_SYNC from \"#variants/debug\"\nimport RELEASE_SYNC from \"#variants/release\"\nimport DEBUG_ASYNC from \"#variants/debug-asyncify\"\nimport RELEASE_ASYNC from \"#variants/release-asyncify\"\n\n/**\n * Create a new, completely isolated WebAssembly module containing the QuickJS library.\n * See the documentation on {@link QuickJSWASMModule}.\n *\n * Note that there is a hard limit on the number of WebAssembly modules in older\n * versions of v8:\n * https://bugs.chromium.org/p/v8/issues/detail?id=12076\n */\nexport async function newQuickJSWASMModule(\n /**\n * Optionally, pass a {@link QuickJSSyncVariant} to construct a different WebAssembly module.\n */\n variant: QuickJSSyncVariant = RELEASE_SYNC,\n): Promise<QuickJSWASMModule> {\n return newQuickJSWASMModuleFromVariant(variant)\n}\n\n/**\n * Create a new, completely isolated WebAssembly module containing a version of the QuickJS library\n * compiled with Emscripten's [ASYNCIFY](https://emscripten.org/docs/porting/asyncify.html) transform.\n *\n * This version of the library offers features that enable synchronous code\n * inside the VM to interact with asynchronous code in the host environment.\n * See the documentation on {@link QuickJSAsyncWASMModule}, {@link QuickJSAsyncRuntime},\n * and {@link QuickJSAsyncContext}.\n *\n * Note that there is a hard limit on the number of WebAssembly modules in older\n * versions of v8:\n * https://bugs.chromium.org/p/v8/issues/detail?id=12076\n */\nexport async function newQuickJSAsyncWASMModule(\n /**\n * Optionally, pass a {@link QuickJSAsyncVariant} to construct a different WebAssembly module.\n */\n variant: QuickJSAsyncVariant = RELEASE_ASYNC,\n): Promise<QuickJSAsyncWASMModule> {\n return newQuickJSAsyncWASMModuleFromVariant(variant)\n}\n\nexport { DEBUG_SYNC, RELEASE_SYNC, DEBUG_ASYNC, RELEASE_ASYNC }\n"],"mappings":";AAAA;AAAA,EAGE;AAAA,EACA;AAAA,OAGK;AACP,OAAO,gBAAgB;AACvB,OAAO,kBAAkB;AACzB,OAAO,iBAAiB;AACxB,OAAO,mBAAmB;AAU1B,eAAsB,qBAIpB,UAA8B,cACF;AAC5B,SAAO,gCAAgC,OAAO;AAChD;AAeA,eAAsB,0BAIpB,UAA+B,eACE;AACjC,SAAO,qCAAqC,OAAO;AACrD;","names":[]}
// src/variants.ts
import {
newQuickJSWASMModuleFromVariant,
newQuickJSAsyncWASMModuleFromVariant
} from "quickjs-emscripten-core";
import DEBUG_SYNC from "#variants/debug";
import RELEASE_SYNC from "#variants/release";
import DEBUG_ASYNC from "#variants/debug-asyncify";
import RELEASE_ASYNC from "#variants/release-asyncify";
async function newQuickJSWASMModule(variant = RELEASE_SYNC) {
return newQuickJSWASMModuleFromVariant(variant);
}
async function newQuickJSAsyncWASMModule(variant = RELEASE_ASYNC) {
return newQuickJSAsyncWASMModuleFromVariant(variant);
}
export {
DEBUG_SYNC,
RELEASE_SYNC,
DEBUG_ASYNC,
RELEASE_ASYNC,
newQuickJSWASMModule,
newQuickJSAsyncWASMModule
};
//# sourceMappingURL=chunk-IP4BVMR7.mjs.map
{"version":3,"sources":["../src/variants.ts"],"sourcesContent":["import {\n QuickJSSyncVariant,\n QuickJSAsyncVariant,\n newQuickJSWASMModuleFromVariant,\n newQuickJSAsyncWASMModuleFromVariant,\n QuickJSWASMModule,\n QuickJSAsyncWASMModule,\n} from \"quickjs-emscripten-core\"\nimport DEBUG_SYNC from \"#variants/debug\"\nimport RELEASE_SYNC from \"#variants/release\"\nimport DEBUG_ASYNC from \"#variants/debug-asyncify\"\nimport RELEASE_ASYNC from \"#variants/release-asyncify\"\n\n/**\n * Create a new, completely isolated WebAssembly module containing the QuickJS library.\n * See the documentation on {@link QuickJSWASMModule}.\n *\n * Note that there is a hard limit on the number of WebAssembly modules in older\n * versions of v8:\n * https://bugs.chromium.org/p/v8/issues/detail?id=12076\n */\nexport async function newQuickJSWASMModule(\n /**\n * Optionally, pass a {@link SyncBuildVariant} to construct a different WebAssembly module.\n */\n variant: QuickJSSyncVariant = RELEASE_SYNC,\n): Promise<QuickJSWASMModule> {\n return newQuickJSWASMModuleFromVariant(variant)\n}\n\n/**\n * Create a new, completely isolated WebAssembly module containing a version of the QuickJS library\n * compiled with Emscripten's [ASYNCIFY](https://emscripten.org/docs/porting/asyncify.html) transform.\n *\n * This version of the library offers features that enable synchronous code\n * inside the VM to interact with asynchronous code in the host environment.\n * See the documentation on {@link QuickJSAsyncWASMModule}, {@link QuickJSAsyncRuntime},\n * and {@link QuickJSAsyncContext}.\n *\n * Note that there is a hard limit on the number of WebAssembly modules in older\n * versions of v8:\n * https://bugs.chromium.org/p/v8/issues/detail?id=12076\n */\nexport async function newQuickJSAsyncWASMModule(\n /**\n * Optionally, pass a {@link AsyncBuildVariant} to construct a different WebAssembly module.\n */\n variant: QuickJSAsyncVariant = RELEASE_ASYNC,\n): Promise<QuickJSAsyncWASMModule> {\n return newQuickJSAsyncWASMModuleFromVariant(variant)\n}\n\nexport { DEBUG_SYNC, RELEASE_SYNC, DEBUG_ASYNC, RELEASE_ASYNC }\n"],"mappings":";AAAA;AAAA,EAGE;AAAA,EACA;AAAA,OAGK;AACP,OAAO,gBAAgB;AACvB,OAAO,kBAAkB;AACzB,OAAO,iBAAiB;AACxB,OAAO,mBAAmB;AAU1B,eAAsB,qBAIpB,UAA8B,cACF;AAC5B,SAAO,gCAAgC,OAAO;AAChD;AAeA,eAAsB,0BAIpB,UAA+B,eACE;AACjC,SAAO,qCAAqC,OAAO;AACrD;","names":[]}
// src/variants.ts
import {
newQuickJSWASMModuleFromVariant,
newQuickJSAsyncWASMModuleFromVariant
} from "quickjs-emscripten-core";
import DEBUG_SYNC from "#variants/debug";
import RELEASE_SYNC from "#variants/release";
import DEBUG_ASYNC from "#variants/debug-asyncify";
import RELEASE_ASYNC from "#variants/release-asyncify";
async function newQuickJSWASMModule(variant = RELEASE_SYNC) {
return newQuickJSWASMModuleFromVariant(variant);
}
async function newQuickJSAsyncWASMModule(variant = RELEASE_ASYNC) {
return newQuickJSAsyncWASMModuleFromVariant(variant);
}
export {
DEBUG_SYNC,
RELEASE_SYNC,
DEBUG_ASYNC,
RELEASE_ASYNC,
newQuickJSWASMModule,
newQuickJSAsyncWASMModule
};
//# sourceMappingURL=chunk-JB5DQL3P.mjs.map
{"version":3,"sources":["../src/variants.ts"],"sourcesContent":["import {\n QuickJSSyncVariant,\n QuickJSAsyncVariant,\n newQuickJSWASMModuleFromVariant,\n newQuickJSAsyncWASMModuleFromVariant,\n QuickJSWASMModule,\n QuickJSAsyncWASMModule,\n} from \"quickjs-emscripten-core\"\nimport DEBUG_SYNC from \"#variants/debug\"\nimport RELEASE_SYNC from \"#variants/release\"\nimport DEBUG_ASYNC from \"#variants/debug-asyncify\"\nimport RELEASE_ASYNC from \"#variants/release-asyncify\"\n\n/**\n * Create a new, completely isolated WebAssembly module containing the QuickJS library.\n * See the documentation on [[QuickJSWASMModule]].\n *\n * Note that there is a hard limit on the number of WebAssembly modules in older\n * versions of v8:\n * https://bugs.chromium.org/p/v8/issues/detail?id=12076\n */\nexport async function newQuickJSWASMModule(\n /**\n * Optionally, pass a {@link SyncBuildVariant} to construct a different WebAssembly module.\n */\n variant: QuickJSSyncVariant = RELEASE_SYNC,\n): Promise<QuickJSWASMModule> {\n return newQuickJSWASMModuleFromVariant(variant)\n}\n\n/**\n * Create a new, completely isolated WebAssembly module containing a version of the QuickJS library\n * compiled with Emscripten's [ASYNCIFY](https://emscripten.org/docs/porting/asyncify.html) transform.\n *\n * This version of the library offers features that enable synchronous code\n * inside the VM to interact with asynchronous code in the host environment.\n * See the documentation on [[QuickJSAsyncWASMModule]], [[QuickJSAsyncRuntime]],\n * and [[QuickJSAsyncContext]].\n *\n * Note that there is a hard limit on the number of WebAssembly modules in older\n * versions of v8:\n * https://bugs.chromium.org/p/v8/issues/detail?id=12076\n */\nexport async function newQuickJSAsyncWASMModule(\n /**\n * Optionally, pass a {@link AsyncBuildVariant} to construct a different WebAssembly module.\n */\n variant: QuickJSAsyncVariant = RELEASE_ASYNC,\n): Promise<QuickJSAsyncWASMModule> {\n return newQuickJSAsyncWASMModuleFromVariant(variant)\n}\n\nexport { DEBUG_SYNC, RELEASE_SYNC, DEBUG_ASYNC, RELEASE_ASYNC }\n"],"mappings":";AAAA;AAAA,EAGE;AAAA,EACA;AAAA,OAGK;AACP,OAAO,gBAAgB;AACvB,OAAO,kBAAkB;AACzB,OAAO,iBAAiB;AACxB,OAAO,mBAAmB;AAU1B,eAAsB,qBAIpB,UAA8B,cACF;AAC5B,SAAO,gCAAgC,OAAO;AAChD;AAeA,eAAsB,0BAIpB,UAA+B,eACE;AACjC,SAAO,qCAAqC,OAAO;AACrD;","names":[]}