mirror of
https://github.com/kmc7468/arkvault.git
synced 2026-11-04 08:10:28 +09:00
13 lines
399 B
TypeScript
13 lines
399 B
TypeScript
import { mkdir, writeFile } from "fs/promises";
|
|
import { dirname, join } from "path";
|
|
import env from "#lib/server/config.js";
|
|
|
|
let sequence = 0;
|
|
|
|
export const createStoredFile = async (content: string | Buffer = "content") => {
|
|
const path = join(env.libraryPath, "test", `file${++sequence}`);
|
|
await mkdir(dirname(path), { recursive: true });
|
|
await writeFile(path, content);
|
|
return path;
|
|
};
|