code: async function exists(dir) {
    try {
      debug(`checking if ${dir} exists`);
      const s = await stat(dir);
  
      debug(`${dir} exists`);
  
      return s.isDirectory();
    }
    catch (err) {
      debug(`${dir} does not exist`);
  
      return false;
    }
  }
docs: Determines if a given file/directory already exists
  @param {string} dir
  @returns {Promise<boolean>}