Read file with promise in Node.js


Andres Canavesi
Sep 10, 2022
featured image
      
const {promises: {readFile}} = require("fs");

const content = await readFile('./test.txt', {encoding:'utf8', flag:'r'});