title: Node.js read a file as a string (not buffer) synchronously
body: <p>How do I read a file in Node.js as a string and not as a buffer? I'm making a program in Node.js. There I need to read a file synchronously, but if I do that, it returns it as a buffer instead of a string. My code looks like that:</p>
  
  <pre><code>const fs = require('fs');
  
  let content = fs.readFileSync('./foo.txt');
  console.log(content) // actually logs it as a buffer
  </code></pre>
  
  <p>Please help.</p>