title: Read from file and find specific lines
body: <p>I need to fetch information in settings a file (I can't change the format) according to certain keywords. The file goes like this:</p>
  
  <pre><code>username=myusername
  address=156a1355e3486f4
  data=function(i){if (i!=0) return true; else return false;}
  </code></pre>
  
  <p>The system is <code>&lt;key&gt;</code> <code>=</code> <code>&lt;value&gt;</code> <code>\n</code>. There can be <code>=</code>, spaces or other characters in the value part, but never line breaks. Keys are unique (in the "key part", they can appear in values, but <code>\nkey=</code> appears only once in the file for every key).</p>
  
  <p>With a shell script, I find my values like this: </p>
  
  <pre><code>username=`grep ^username file.txt | sed "s/^username=//"`
  </code></pre>
  
  <p>Grep will return <code>username=someusername</code> and sed replaces the key and <code>=</code> with nothing, leaving only the value.</p>
  
  <p>In node.js, I would like to access <em>some</em> of the data in the file. For example, I want the value for address and data.</p>
  
  <p>How could I do this in node.js ? After <code>fs.readFile(file.txt)</code> I don't know what to do. I guess I will have to use <code>split</code>, but using <code>\n</code> doesn't seem to be the best option, maybe regex can help ?</p>
  
  <p>The ideal thing would be to "find a substring starting with <code>\nkey=</code> and ending with the first <code>\n</code>", then I could easily split to find the value.</p>