code: function ensureFolderExists(file) {
      var folderName = path.dirname(file);
      if (fs.existsSync(folderName)) {
          return;
      }
      try {
          mkdirp.sync(folderName);
      }
      catch (e) {
          console.log(colors.red("Unable to create parent folders for: " + file), e);
      }
  }
docs: Ensures the parent folders for the given file name exists.