title: How to write file if parent folder doesn't exist?
body: <p>I need to write file to the following path:</p>
  
  <pre class="lang-js prettyprint-override"><code>fs.writeFile('/folder1/folder2/file.txt', 'content', function () {…});
  </code></pre>
  
  <p>But <code>'/folder1/folder2'</code> path may not exists. So I get the following error:</p>
  
  <blockquote>
    <p>message=ENOENT, open /folder1/folder2/file.txt</p>
  </blockquote>
  
  <p>How can I write content to that path?</p>