sandboxedjs 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1435,6 +1435,21 @@ interface ContainerOptions {
1435
1435
  onStderr?: (chunk: string) => void;
1436
1436
  /** Invoked when an in-container HTTP server starts listening. */
1437
1437
  onServerReady?: (port: number, url: string) => void;
1438
+ /**
1439
+ * Supply the Nodepod instance instead of letting the container boot one.
1440
+ *
1441
+ * The default path imports `@scelar/nodepod/headless`, which installs a
1442
+ * `worker_threads` host and is the right choice on Node. In a browser you
1443
+ * boot Nodepod's browser build yourself (it needs a service worker) and hand
1444
+ * the instance over:
1445
+ *
1446
+ * ```ts
1447
+ * import { Nodepod } from "@scelar/nodepod";
1448
+ * const pod = await Nodepod.boot({ ... });
1449
+ * const box = await createContainer({ pod });
1450
+ * ```
1451
+ */
1452
+ pod?: Nodepod;
1438
1453
  }
1439
1454
  interface ExecOptions {
1440
1455
  cwd?: string;
package/dist/index.d.ts CHANGED
@@ -1435,6 +1435,21 @@ interface ContainerOptions {
1435
1435
  onStderr?: (chunk: string) => void;
1436
1436
  /** Invoked when an in-container HTTP server starts listening. */
1437
1437
  onServerReady?: (port: number, url: string) => void;
1438
+ /**
1439
+ * Supply the Nodepod instance instead of letting the container boot one.
1440
+ *
1441
+ * The default path imports `@scelar/nodepod/headless`, which installs a
1442
+ * `worker_threads` host and is the right choice on Node. In a browser you
1443
+ * boot Nodepod's browser build yourself (it needs a service worker) and hand
1444
+ * the instance over:
1445
+ *
1446
+ * ```ts
1447
+ * import { Nodepod } from "@scelar/nodepod";
1448
+ * const pod = await Nodepod.boot({ ... });
1449
+ * const box = await createContainer({ pod });
1450
+ * ```
1451
+ */
1452
+ pod?: Nodepod;
1438
1453
  }
1439
1454
  interface ExecOptions {
1440
1455
  cwd?: string;