how to read file in javascript fs code example
Example 1: javascript fs read
fs.readFile('/etc/passwd', (err, data) => {
if (err) throw err;
console.log(data);
});
Example 2: fs readfile encoding
fs.readFile('/etc/passwd', 'utf8', callback);