title: Node.js readFileSync ZIP file
body: <p>I am trying to read a ZIP file and output it to the browser, get the code that's shown on the page and save it as a ZIP file</p>
  
  <pre><code>fs.readFileSync('/dir/file.zip','utf-8')
  </code></pre>
  
  <p>When I do this, I get output that starts with <code>PK�coG���^�*filename.txt</code> and goes on for a bit longer. When I save the resulting text as file.zip however, I can't extract the file. It says its corrupt or not a valid ZIP file.</p>
  
  <p>If I open a very similar file I have in Notepad++, the start and ends are pretty similar. Am I missing something obvious?</p>
  
  <p>Any ideas how to get the contents of the ZIP file, save it so I can extract it, only using the <code>fs.readFileSync</code> function?</p>