I cannot figure out how async/await works. I slightly understands it but I can\'t make it work.
async
await
You can use fs.promises available natively since Node v11.0.0
fs.promises
import fs from 'fs'; const readFile = async filePath => { try { const data = await fs.promises.readFile(filePath, 'utf8') return data } catch(err) { console.log(err) } }