rafaelmaeuer
8/9/2017 - 5:01 PM

node.js: read a text file into an array - From https://stackoverflow.com/questions/6831918/node-js-read-a-text-file-into-an-array-each-line-

var fs = require('fs');
var array = fs.readFileSync('file.txt').toString().split("\n");
for(i in array) {
    console.log(array[i]);
}