fs.readFile('filename', function read(err, data) { if (err) { throw err; } var content = data; console.log(content); });