title: How to turn a file into a string in NodeJS
body: <p>I am attempting to convert a text file (on my machine) into a string. What is the best/simplest way to do this?
  I am looking for a basic function that would look like this:</p>
  
  <pre><code>function fileToString(filepath) {
     //this returns a string with the contents of the file
  }
  </code></pre>
  
  <p>How should I do this?</p>
  
  <p>EDIT: I now know that there is another question that asks this, but I didn't understand that question so I asked it in different words.</p>