簡體   English   中英

從 nodejs 中的私有 github 存儲庫下載文件

[英]download a file from private github repository in nodejs

我需要從 nodeJS 中的私有 github 存儲庫下載單個文件。 有沒有辦法做到這一點?

我嘗試使用 wget 和 curl。 它們非常適合公共存儲庫。 但是我找不到任何從私人存儲庫下載的方法。

提前致謝

鑒於您有權訪問該存儲庫,您將需要為此創建一個 github 令牌。

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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM