Node.js fs readFile() handle error

Description

Node.js fs readFile() handle error


var fs = require("fs");

fs.readFile('input.txt',function(err,data){
  if (err) return console.error(err);
  console.log(data.toString());/* w ww  .  j  a v  a2s  .com*/
});

console.log("over");



PreviousNext

Related