#JavaInspires
#NodeJsPractice
In Node.js,
From fs module,
fs.access can be used to check whether the file exits in the directory or not
'fs.access(path, [mode],callback);'
where
path = filepath
mode = specifies the accessibilty check
callback = callback function (with err argument)
To check if the file exist or not pass mode as
'fs.constants.F_OK'