Node.js fs read sync text file
var fs = require("fs"); var data = fs.readFileSync("test.txt"); console.log(data);//from www . ja va 2 s . co m console.log("Do other tasks");