【发布时间】:2020-05-28 00:08:23
【问题描述】:
我在浏览 next.js 存储库时注意到了这个从 GitHub 下载并提取模板的功能,带有 tar:
export async function downloadAndExtractExample(
root: string,
name: string
): Promise<void> {
return await promisePipe(
got.stream('https://codeload.github.com/zeit/next.js/tar.gz/canary'),
tar.extract({ cwd: root, strip: 3 }, [`next.js-canary/examples/${name}`])
)
}
我在 StackOverflow 上搜索,我只找到了这个:
这是一个解释如何从 GitHub 提取 tar.gz 的线程,但没有提及“codeload”子域。和“api”有什么区别?
【问题讨论】:
标签: github github-api tar