How To Read a file in Node JS

In this tutorial, you will learn how to read a file in Node JS. In order to do this, you have to include a built-in module of Node JS known as fs( File System) with the help of require() method as shown below var fs = require(“fs”);fs.readFile(“name of the file”,”encoding”,”function(err,data)) Please note that the readFile() … Read more