How to retrieve the list of all GitHub repositories of a person?

后端 未结 15 1239
一个人的身影
一个人的身影 2020-12-02 05:43

We are working on a project where we need to display all the projects of a person in his repository on GitHub account.

Can anyone suggest, how can I display the na

15条回答
  •  一向
    一向 (楼主)
    2020-12-02 06:22

    The NPM module repos grabs the JSON for all public repos for some user or group. You can run this directly from npx so you don't need to install anything just pick an org or user ("W3C" here):

    $ npx repos W3C W3Crepos.json
    

    This will create a file called W3Crepos.json. Grep is good enough to e.g. fetch the list of repos:

    $ grep full_name W3Crepos.json
    

    pros:

    • Works with more than 100 repos (many answers to this question don't).
    • Not much to type.

    cons:

    • Requires npx (or npm if you want to install it for real).

提交回复
热议问题