📅  最后修改于: 2022-03-11 15:02:36.404000             🧑  作者: Mango
const fs = require('fs');
fs.readFile('file.txt', function(err, data) {
if(err) throw err;
const arr = data.toString().replace(/\r\n/g,'\n').split('\n');
for(let i of arr) {
console.log(i);
}
});