Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

fs , valid path check

const fs = require('fs')

const path = './file.txt'

try {
  if (fs.existsSync(path)) {
    //file exists
  }
} catch(err) {
  console.error(err)
}
Source by flaviocopes.com #
 
PREVIOUS NEXT
Tagged: #fs #valid #path #check
ADD COMMENT
Topic
Name
3+8 =