code: function mkdirs(folderPath, mode) {
    var folders = [];
    var tmpPath = path.normalize(folderPath);
    var exists = fs.existsSync(tmpPath);
    while (!exists) {
      folders.push(tmpPath);
      tmpPath = path.join(tmpPath, '..');
      exists = fs.existsSync(tmpPath);
    }
  
    for (var i = folders.length - 1; i >= 0; i--) {
      fs.mkdirSync(folders[i], mode);
    }
  }
docs: Creates all sub-directories for a nested path
  Thanks to https://github.com/grj1046/node-mkdirs/blob/master/index.js