title: creating a directory with subdirectories and files in node
body: <p>i want to run a script that will create a directory and within a file and subdirectory, something like this</p>
  
  <pre><code>main-folder 
      &gt; sub-folder
      &gt; file
  </code></pre>
  
  <p>so far i haven't had any luck, my thought is trying to writeFile within the mkDir function</p>
  
  <pre><code>const fileGenerator = (fileName, fileContent) =&gt; {
      fs.writeFile(fileName, fileContent, (err) =&gt; {
          if (err) throw err;
          console.log('The file has been saved!');
      });
  }
  
  fs.mkdir('main-folder', err =&gt; {
      if (err) {
          console.log(err);
      } else {
          fileGenerator('index.html', 'hello');
          console.log('Directory Created');
          fs.mkdir('sub-folder', err =&gt; {
          if (err) {
              console.log(err);
          } else {
              console.log('Directory Created');
          }
      })
      }
  })
  </code></pre>