同步读文件
var fs = require('fs');
var fileStream = fs.readFileSync('/data/file.txt');
console.info(fileStream.toString());
异步读文件
var fs = require('fs');
fs.readFile('/data/file.txt', function(err, data){
console.info(data.toString());
});
var fs = require('fs');
var fileStream = fs.readFileSync('/data/file.txt');
console.info(fileStream.toString());
var fs = require('fs');
fs.readFile('/data/file.txt', function(err, data){
console.info(data.toString());
});