Saved from https://flaviocopes.com/how-to-check-if-file-exists-node/
const fs = require('fs') const path = './file.txt' try { if (fs.existsSync(path)) { //file exists } } catch(err) { console.error(err) }