title: phantomjs javascript read a local file line by line
body: <p>I've never used javascript to read a file line by line, and phantomjs is a whole new ballgame for me. i know that there is a read() function in phantom, but I'm not entirely sure how to manipulate the data after storing it to a variable. My pseudocode is something like:</p>
  
  <pre><code>filedata = read('test.txt');
  newdata = split(filedata, "\n");
  foreach(newdata as nd) {
  
    //do stuff here with the line
  
  }
  </code></pre>
  
  <p>If anyone could please help me with real code syntax, I'm a bit confused as to whether or not phantomjs will accept typical javascript or what.</p>