UNPKG
file-check
Version:
latest (1.0.0)
1.0.0
Check if path is a file
github.com/tobihrbr/file-check
tobihrbr/file-check
file-check
/
lib
/
app.js
11 lines
(9 loc)
•
202 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
const
fs =
require
(
'fs'
);
module
.
exports
=
function
(
path
) {
if
(fs.
existsSync
(path)) {
const
stats = fs.
lstatSync
(path);
return
stats.
isFile
(); }
else
{
return
false
; } };