From 310d0a7324477079022b178f1a83161e9e61fb1d Mon Sep 17 00:00:00 2001 From: amankumarsingh77 Date: Sat, 2 May 2026 15:31:01 +0530 Subject: feat(util): add result, time, and paths primitives for v0.3 rewrite --- src/util/paths.ts | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 src/util/paths.ts (limited to 'src/util/paths.ts') 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`); -- cgit v1.2.3