mirror of
https://github.com/wireadmin/wireadmin
synced 2025-06-26 18:28:06 +00:00
16 lines
327 B
TypeScript
16 lines
327 B
TypeScript
import { accessSync, promises } from 'node:fs';
|
|
|
|
export function fsAccess(path: string): boolean {
|
|
try {
|
|
accessSync(path);
|
|
return true;
|
|
} catch (error) {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
export async function fsTouch(filePath: string): Promise<void> {
|
|
const fd = await promises.open(filePath, 'a');
|
|
await fd.close();
|
|
}
|