I have a code like this below. The code still use callback function and i want to change using promise. I hesistate how to change them. can you help how change it
const fs = require('fs')
fs.readdir('/', (err, result) => {
if (err) {
throw new Error(err.message)
}
console.log(result)
})