How to check whether the file exists or not using Node Js Code | Java Inspires

Published: 25 April 2020
on channel: Java Inspires
761
2

#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'


Watch video How to check whether the file exists or not using Node Js Code | Java Inspires online without registration, duration hours minute second in high quality. This video was added by user Java Inspires 25 April 2020, don't forget to share it with your friends and acquaintances, it has been viewed on our site 761 once and liked it 2 people.