[英]download a file from private github repository in nodejs
I need to download a single file from a private github repository in nodeJS.我需要从 nodeJS 中的私有 github 存储库下载单个文件。 Is there any way to do that?
有没有办法做到这一点?
I tried with wget and curl.我尝试使用 wget 和 curl。 They worked perfectly for public repositories.
它们非常适合公共存储库。 But I couldn't find any method to download from private repository.
但是我找不到任何从私人存储库下载的方法。
Thanks in Advance提前致谢
You will need to create a github token for that, given that you have access to the repo.鉴于您有权访问该存储库,您将需要为此创建一个 github 令牌。
Example with curl
curl
示例
curl --header 'Authorization: token <GH-TOKEN>' \
--header 'Accept: application/vnd.github.v3.raw' \
--remote-name \
--location https://api.github.com/repos/owner/repo/contents/path
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.