NODEJS -- fileExists
Check if a file exists in a certain directoryunknown
javascript
a year ago
221 B
1
Indexable
Never
const fs = require('fs'); // Check if a file exists fs.access('path/to/file', fs.constants.F_OK, (err) => { if (err) { console.log('File does not exist'); } else { console.log('File exists'); } });