This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require("fs"); | |
const path = require("path") | |
// Resolve file path | |
const filePath = path.resolve("../", "data", "file.txt") | |
// Read file asynchronously | |
// 3rd params of this method is a callback function, which will return error and data | |
fs.readFile(filePath, "utf8", (err, data) => { | |
if (err) { |