List of utility methods to do File Read
fs.readFilevar fs = require("fs"); var x = []; for (var i = 0; i < 6; i++) { x.push([]); for (var j=0; j<50; j++) { x[i].push(" "); fs.readFile("l8.txt", "utf8", function (e, d) { ... | |
fs.readFilevar fs = require('fs'); fs.readFile('rule.txt', function(err, data){ if (err) {console.log(err);return;} var data = data.toString(); data = data.split(/\n|\r/g).trimNull(); console.log(data); }); |