aboutsummaryrefslogtreecommitdiff
path: root/src/util/paths.ts
diff options
context:
space:
mode:
authoramankumarsingh77 <amankumarsingh7702@gmal.com>2026-05-02 15:31:01 +0530
committeramankumarsingh77 <amankumarsingh7702@gmal.com>2026-05-02 15:31:01 +0530
commit310d0a7324477079022b178f1a83161e9e61fb1d (patch)
tree69e7bbad57cdffe8e8e174fbd6b84fa88388a7fe /src/util/paths.ts
parent6759b6fd0ab435aa1e9fdb4591bd828b7a861a33 (diff)
feat(util): add result, time, and paths primitives for v0.3 rewrite
Diffstat (limited to 'src/util/paths.ts')
-rw-r--r--src/util/paths.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/util/paths.ts b/src/util/paths.ts
new file mode 100644
index 0000000..8cd9961
--- /dev/null
+++ b/src/util/paths.ts
@@ -0,0 +1,9 @@
+import { randomUUID } from "node:crypto";
+import { tmpdir } from "node:os";
+import { join } from "node:path";
+
+export const screenshotPath = (namespace: string, ext: "png" | "jpeg" = "png"): string =>
+ join(tmpdir(), `pi-browser-screenshot-${namespace}-${randomUUID()}.${ext}`);
+
+export const pdfPath = (namespace: string): string =>
+ join(tmpdir(), `pi-browser-pdf-${namespace}-${randomUUID()}.pdf`);