title: How to create an in memory eml file with JavaScript?
body: <p>How can I create a client side in-memory eml file? I've come across numerous suggestions. But none, out of the box, work in my setup. Namely where</p>
  
  <ul>
  <li>the code that creates an eml file resides in a NodeJS library</li>
  <li>browserify is used against this library to generate a bundle.js</li>
  <li>bundle.js is used to make this behaviour available in a browser</li>
  </ul>
  
  <p>Some of the technics I've investigated but discounted so far</p>
  
  <p><a href="https://www.npmjs.com/package/eml-format" rel="nofollow noreferrer">https://www.npmjs.com/package/eml-format</a></p>
  
  <p><a href="https://github.com/BramEsposito/eml-to-pdf" rel="nofollow noreferrer">https://github.com/BramEsposito/eml-to-pdf</a></p>
  
  <p>Depend on the 'fs' module which browserify complains about</p>
  
  <p><a href="https://www.example-code.com/nodejs/email_examine_eml.asp" rel="nofollow noreferrer">https://www.example-code.com/nodejs/email_examine_eml.asp</a></p>
  
  <p>Licenced</p>
  
  <p><a href="https://github.com/nodemailer/mailparser" rel="nofollow noreferrer">https://github.com/nodemailer/mailparser</a></p>
  
  <p>Looked promising but specific to reading existing emails not creating them.</p>
  
  <p><a href="https://www.npmjs.com/package/mime" rel="nofollow noreferrer">https://www.npmjs.com/package/mime</a>
  <a href="https://www.npmjs.com/package/mime-types" rel="nofollow noreferrer">https://www.npmjs.com/package/mime-types</a></p>
  
  <p>Is not used to create eml files.</p>
  
  <p><a href="https://github.com/ikr0m/mime-js" rel="nofollow noreferrer">https://github.com/ikr0m/mime-js</a></p>
  
  <p>Looks promising but I've yet to get it to work.</p>