Answers for "13) Reading to and Writing from the File System in Node JS."

2

read a file nodejs

const fs = require('fs');

fs.readFile('my-file.txt', 'utf8', function(err, data) {
    if (err) throw err;
    console.log(data);
});
Posted by: Guest on April-17-2021

Code answers related to "13) Reading to and Writing from the File System in Node JS."

Code answers related to "Javascript"

Browse Popular Code Answers by Language