UNPKG
patch-asar
Version:
latest (0.6.4)
0.6.4
0.6.3
0.6.2
0.6.1
0.6.0
0.5.5
0.5.4
0.5.2
0.5.1
Patch .asar archives
github.com/L1lith/patch-asar
L1lith/patch-asar
patch-asar
/
source
/
functions
/
isDirectory.js
15 lines
(13 loc)
•
290 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import
{ stat }
from
"fs/promises"
;
export
default
async
function
isDirectory
(
path
) {
try
{
return
(
await
stat
(path)).
isDirectory
(); }
catch
(err) {
if
(err.
code
===
"ENOENT"
) {
// The directory doesn't exist
return
false
; }
else
{
throw
err; } } }