1
1
mirror of https://github.com/theoludwig/programming-challenges.git synced 2025-05-18 12:02:53 +02:00
Files
programming-challenges/cli/utils/isExistingPath.ts
2021-07-03 18:40:17 +02:00

11 lines
213 B
TypeScript

import fs from 'node:fs'
export const isExistingPath = async (path: string): Promise<boolean> => {
try {
await fs.promises.access(path, fs.constants.F_OK)
return true
} catch {
return false
}
}