SHARE
TWEET

Untitled

a guest Mar 22nd, 2019 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const fs = require('fs')
  2.  
  3. const path = './file.txt'
  4.  
  5. try {
  6.   if (fs.existsSync(path)) {
  7.     //file exists
  8.   }
  9. } catch(err) {
  10.   console.error(err)
  11. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top