Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const fs = require('fs')
- const path = './file.txt'
- try {
- if (fs.existsSync(path)) {
- //file exists
- }
- } catch(err) {
- console.error(err)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement