code: async function viaContentsApi(identifier, dir, token) {
  	const files = [];
  	const requests = [];
  	const {repo, ref} = parseIdentifier(identifier);
  	const contents = await api(`${repo}/contents/${dir}?ref=${ref}`, token);
  	for (const item of contents) {
  		if (item.type === 'file') {
  			files.push(item.path);
  		} else if (item.type === 'dir') {
  			requests.push(viaContentsApi(repo, item.path, token));
  		}
  	}
  	return files.concat(...await Promise.all(requests));
  }
docs: Great for downloads with few sub directories on big repos Cons: many requests if the repo has a lot of nested dirs