ensureDir(dir, format = false) {
    if (format) dir = path.dirname(dir);
    fs.ensureDir(dir);
  }
Ensures that the directory exists. If the directory structure does not exist, it is created.
@public