I want to pass the strings of a txt file to an array and as soon as each line was passed to the array the program would run it normally, then it would repeat and pick up the second string from the txt file. Everything is being done in javascript / nodejs but it's been 2 days since I've stopped working on it and I can not get out of the corner.
loop code with the file and array:
function email_parser(){
var fs = require('fs');
var email_count = "";
var array = [];
var array = fs.readFileSync('email.txt').toString().split("rn");
for(var i = 0; i < array.length; i++) {
email_count = array[i];
}}
and I'm calling the variable this way
email = email_parser();
Thank you!