Read directory async error handline
- readdir
const fs = require('fs')
fs.readdir('xyz', function (err, files) {
if (err) {
console.log('Error', err);
} else {
console.log(files);
}
})
Press ← or → to navigate between chapters
Press S or / to search in the book
Press ? to show this help
Press Esc to hide this help
const fs = require('fs')
fs.readdir('xyz', function (err, files) {
if (err) {
console.log('Error', err);
} else {
console.log(files);
}
})