/dotseeker

Collect dotfiles from GitHub repositories.

Primary LanguageJavaScriptMIT LicenseMIT

Actions Status License: MIT

dotseeker

Collect dotfile (e.g. .zshrc) from GitHub repositories which has dotfiles topic.

Usage

Install packages.

yarn install

Set GITHUB_API_TOKEN in .env file or environment.

GITHUB_API_TOKEN=xxxxxxxxxxxxxxxxx

Execute!

yarn start

dotseeker downloads dotfile into files directory.

# example for reireias/dotfile repository
files
└── reireias
    └── dotfiles
        ├── .bashrc
        └── .zshrc

Customize

You can customize this search logic.

await new Seeker(params).seek()

If params not specified, Seeker use default params.

The default params is follows.

params = {
  q: 'topic:dotfiles',
  sort: 'stars',
  page: 1,
  perPage: 10,
  filenamePattern: /^.*\.?(bashrc|bash_profile|zshrc|zsh_profile)/
}

The params structure is follows.

params = {
  q: String,
  sort: String,
  page: Number,
  perPage: Number,
  filenamePattern: Regexp Object
}

q

q is a query for searching repository.

See GitHub API Document

sort

sort is a sort option for searching repository.

  • stars, forks, help-wanted-issues, updated are allows.

See GitHub API Document

page

page is the page number for searching result pagenation.

See GitHub API Pagenation Document

perPage

perPage is the number of repository in one page for searching result pagenation.

See GitHub API Pagenation Document

filenamePattern

The regexp object for filtering download file.

Example

/^.*\.?(bashrc|bash_profile|zshrc|zsh_profile)/