repos2md

Export repos list to a markdown file.

Usage no npm install needed!

<script type="module">
  import repos2md from 'https://cdn.skypack.dev/repos2md';
</script>

README

repos2md npm version

Export GutHub user repos list to a markdown file.

NPM

NPM

install

# globally

❯ yarn global add repos2md

# or in project

❯ yarn add repos2md

usage

cli

❯ repos2md --help

  Export repos list to a markdown file.

  repos2md v2.0.0

  Usage
    $ repos2md <username>
    $ repos2md <username> --save-to <path> --token <token> --exclude-repos-count

  Options
    --starred                 optional (default is user repos)        If provided, user's starred repos will be fetched
    --save-to                 optional (defaults to project root)     Absolute path to the target file (.md document) to write to
    --token                   optional (includes private repos)       Your GitHub token (if you want to inclide private repos)
    --exclude-repos-count     optional                                Exclude repos count from heading in target file

  Examples
    $ repos2md frenchbread
    $ repos2md frenchbread --starred --save-to /Users/frenchbread/Desktop --exclude-repos-count

nodejs

const repos2md from 'repos2md'


repos2md('github')
  .then(saved_to => console.log(`Repos saved to "${saved_to}"`))

api

repos2md(github_username, options?)

Returns <path> to where file has been saved.

options

type: object

  • starred

    type: boolean

    Fetch user's starred repos.

  • save_to

    type: string

    Custom path to where write file to. Can be both relative & absolute.

  • token

    type: string

    GitHub token, used to include private repos.

  • exclude_repos_count

    type: boolean

    Exclude repos count from target doc.

note!

For unauthenticated requests, the rate limit allows for up to 60 requests per hour. Unauthenticated requests are associated with the originating IP address, and not the user making requests.

Source

todos

  • Change input username/path approach
  • Write & add tests
  • Handle paths containing ~

Contributions are welcome!

author

license

MIT