UNPKG
demos
Version:
latest (1.0.0)
1.0.0
demos
/
Demo
/
Day2
/
4-Path
/
4.exist.js
10 lines
(7 loc)
•
214 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
var
path=
require
(
'path'
);
var
fs=
require
(
'fs'
);
var
mypage = path.
join
(process.
cwd
(),
"join1.js"
) fs.
exists
(mypage,
function
(
exists
){
console
.
log
(
"Does the file exist?"
, exists) }) fs.
existsSync
(mypage)