mirror of
https://github.com/khairul169/code-share.git
synced 2025-04-29 00:59:37 +07:00
16 lines
316 B
TypeScript
16 lines
316 B
TypeScript
import fs from "node:fs";
|
|
import path from "node:path";
|
|
|
|
export const fileExists = (path: string) => {
|
|
try {
|
|
fs.accessSync(path, fs.constants.F_OK);
|
|
return true;
|
|
} catch (e) {
|
|
return false;
|
|
}
|
|
};
|
|
|
|
export const getProjectDir = () => {
|
|
return path.resolve(process.cwd(), "storage/tmp/project1");
|
|
};
|