Sync:(同步:)
var fs = require('fs');
var obj = JSON.parse(fs.readFileSync('file', 'utf8'));
Async:(异步:)
var fs = require('fs');
var obj;
fs.readFile('file', 'utf8', function (err, data) {
if (err) throw err;
obj = JSON.parse(data);
});
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…