UNPKG
@santerzet/botkit
Version:
latest (0.1.0)
0.1.0
0.0.4
0.0.3
0.0.2
0.0.1
CLI for Discord Bot
@santerzet/botkit
/
src
/
functions
/
FileExists.ts
9 lines
(6 loc)
•
251 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
import
{ fromAsync, isOk }
from
'@sapphire/result'
;
import
{ access }
from
'node:fs/promises'
;
export
async
function
fileExists
(
filePath
:
string
):
Promise
<
boolean
> {
const
result =
await
fromAsync
(
() =>
access
(filePath));
return
isOk
(result); }