【问题标题】:download a file from private github repository in nodejs从 nodejs 中的私有 github 存储库下载文件
【发布时间】:2020-04-02 11:03:31
【问题描述】:

我需要从 nodeJS 中的私有 github 存储库下载单个文件。有什么办法吗?

我尝试使用 wget 和 curl。它们非常适合公共存储库。但是我找不到任何从私有存储库下载的方法。

提前致谢

【问题讨论】:

    标签: node.js curl github wget


    【解决方案1】:

    您需要为此创建一个 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
    

    【讨论】:

      猜你喜欢
      • 2017-02-03
      • 2020-12-09
      • 2016-05-30
      • 1970-01-01
      • 1970-01-01
      • 2021-11-02
      • 1970-01-01
      • 2021-08-01
      • 1970-01-01
      相关资源
      最近更新 更多