Answers for "fs , valid path check"

0

fs , valid path check

const fs = require('fs')

const path = './file.txt'

try {
  if (fs.existsSync(path)) {
    //file exists
  }
} catch(err) {
  console.error(err)
}
Posted by: Guest on August-11-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language