Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

read a file nodejs

const fs = require('fs');

fs.readFile('my-file.txt', 'utf8', function(err, data) {
    if (err) throw err;
    console.log(data);
});
 
PREVIOUS NEXT
Tagged: #read #file #nodejs
ADD COMMENT
Topic
Name
6+5 =