We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eb7fca7 commit 695dc5bCopy full SHA for 695dc5b
lib/utils/temp-dir.test.ts
@@ -0,0 +1,8 @@
1
+import { expect, test } from "vitest";
2
+import { tempDir } from "./temp-dir";
3
+
4
+test("tempDir", async () => {
5
+ await using dir = await tempDir();
6
+ expect(dir).toBeDefined();
7
+ expect(dir.path).toBeDefined();
8
+});
lib/utils/temp-dir.ts
+import { mkdtempDisposable, realpath } from "node:fs/promises";
+import { tmpdir } from "node:os";
+import { join } from "node:path";
+export async function tempDir() {
+ const realTmpDir = await realpath(tmpdir());
+ return await mkdtempDisposable(join(realTmpDir, "jsdocs-io-web-"));
+}
0 commit comments