Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

read txt file in node js

var fs = require('fs');

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