function rimraf (dirPath, removeSelf = true) {
  if (fs.existsSync(dirPath)) {
    fs.readdirSync(dirPath).forEach(function (entry) {
      const entryPath = path.join(dirPath, entry);
      if (fs.lstatSync(entryPath).isDirectory()) {
        rimraf(entryPath);
      } else {
        fs.unlinkSync(entryPath);
      }
    });
    if (removeSelf) {
      fs.rmdirSync(dirPath);
    }
  } else {
    if (!removeSelf) {
      fs.mkdirSync(dirPath);
    }
  }
}
Remove directory recursively
@param {string} dirPath - Path to directory
@param {boolean} [removeSelf=true] - Remove directory itself
@see https://stackoverflow.com/a/42505874/14350317