title: How do I password protect a zip file in Nodejs?
body: <p>I am creating a zip file using archiver. below is my code to do it. I need to password protect it. How can I do it?</p>
  
  <pre><code>var head={'Content-Type':'application/octet-stream','Content-disposition':'attachment; filename='+zipName,'Transfer-Encoding':'chunked' }
  
  res.writeHead(200,head);
  
  var archive = archiver('zip');
  
  archive.pipe(res);
  
  archive.append(result, { name: attachment.aliasFileName });
  
  archive.finalize();
  
  return res.send("thanks");
  </code></pre>