Rebasely Beta: data may be purged

justintypescript-ultra-strict Public

Text · 13 lines · 506 B · at 6dae872

import { readFile } from "node:fs/promises";import { wrapAsync } from "@tsus/runtime/boundary";const safeRead = wrapAsync(readFile);const here = new URL("data.txt", import.meta.url).pathname;const nowhere = new URL("missing.txt", import.meta.url).pathname;const found = await safeRead(here, "utf8");const missing = await safeRead(nowhere, "utf8");console.log(found.map((text) => text.trim()).unwrapOr("<read failed>"));console.log(missing.map((text) => text.trim()).unwrapOr("<read failed>"));