{"id":23991564,"url":"https://github.com/nikelborm/fetch-github-folder","last_synced_at":"2026-04-21T18:42:56.377Z","repository":{"id":205239611,"uuid":"713740352","full_name":"nikelborm/fetch-github-folder","owner":"nikelborm","description":"Download any directory at any depth from any repo on GitHub on any git ref","archived":false,"fork":false,"pushed_at":"2025-09-29T06:37:05.000Z","size":18366,"stargazers_count":7,"open_issues_count":29,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-29T08:24:49.389Z","etag":null,"topics":["directory","download","downloader","effect-ts","git","github","github-api","javascript","nodejs","npm","octokit","octokit-js","scraper","script","typescript"],"latest_commit_sha":null,"homepage":"https://nikelborm.github.io/fetch-github-folder/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nikelborm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"nikelborm"}},"created_at":"2023-11-03T06:27:30.000Z","updated_at":"2025-09-29T06:37:03.000Z","dependencies_parsed_at":"2023-11-17T22:58:50.517Z","dependency_job_id":"181a443a-cca6-4217-837e-11909d0ca40d","html_url":"https://github.com/nikelborm/fetch-github-folder","commit_stats":{"total_commits":20,"total_committers":1,"mean_commits":20.0,"dds":0.0,"last_synced_commit":"6362f0982698eea770b920f988f3cac78899daca"},"previous_names":["nikelborm/download-github-folder","nikelborm/fetch-github-folder"],"tags_count":52,"template":false,"template_full_name":null,"purl":"pkg:github/nikelborm/fetch-github-folder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikelborm%2Ffetch-github-folder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikelborm%2Ffetch-github-folder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikelborm%2Ffetch-github-folder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikelborm%2Ffetch-github-folder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nikelborm","download_url":"https://codeload.github.com/nikelborm/fetch-github-folder/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikelborm%2Ffetch-github-folder/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32105857,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-21T11:25:29.218Z","status":"ssl_error","status_checked_at":"2026-04-21T11:25:28.499Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["directory","download","downloader","effect-ts","git","github","github-api","javascript","nodejs","npm","octokit","octokit-js","scraper","script","typescript"],"created_at":"2025-01-07T19:56:01.880Z","updated_at":"2026-04-21T18:42:56.356Z","avatar_url":"https://github.com/nikelborm.png","language":"TypeScript","readme":"# \u003cimg src=\"https://nikelborm.github.io/fetch-github-folder/logo.png\" align=\"right\" width=\"40px\" height=\"40px\"/\u003e fetch-github-folder :lizard:\n\n[![Open in VS Code](https://img.shields.io/static/v1?logo=visualstudiocode\u0026label=\u0026message=Open%20in%20VS%20Code\u0026labelColor=2c2c32\u0026color=007acc\u0026logoColor=007acc)](https://github.dev/nikelborm/fetch-github-folder)\n[![NPM package version](https://badge.fury.io/js/fetch-github-folder.svg)](https://www.npmjs.com/package/fetch-github-folder)\n[![NPM downloads](https://img.shields.io/npm/dm/fetch-github-folder.svg?style=flat)](https://npmjs.org/package/fetch-github-folder)\n[![NPM Last Update](https://img.shields.io/npm/last-update/fetch-github-folder)](https://npmjs.org/package/fetch-github-folder)\n[![package.json Dependencies count](https://badgen.net/bundlephobia/dependency-count/fetch-github-folder)](https://www.npmjs.com/package/fetch-github-folder?activeTab=dependencies)\n[![package.json Dependents count](https://badgen.net/npm/dependents/fetch-github-folder)](https://www.npmjs.com/package/fetch-github-folder?activeTab=dependents)\n[![JSR package version](https://jsr.io/badges/@nikelborm/fetch-github-folder)](https://jsr.io/@nikelborm/fetch-github-folder)\n[![JSR package Score](https://jsr.io/badges/@nikelborm/fetch-github-folder/score)](https://jsr.io/@nikelborm/fetch-github-folder)\n[![JSR package owner](https://jsr.io/badges/@nikelborm)](https://jsr.io/@nikelborm)\n[![GitHub commits per month](https://img.shields.io/github/commit-activity/m/nikelborm/fetch-github-folder)](https://github.com/nikelborm/fetch-github-folder/pulse)\n[![GitHub Total commits Count](https://img.shields.io/github/commit-activity/t/nikelborm/fetch-github-folder)](https://github.com/nikelborm/fetch-github-folder/graphs/commit-activity)\n[![NPM License](https://img.shields.io/npm/l/fetch-github-folder)](https://github.com/nikelborm/fetch-github-folder?tab=MIT-1-ov-file)\n[![Coveralls Coverage Percentage](https://coveralls.io/repos/github/nikelborm/fetch-github-folder/badge.svg?branch=main\u0026rand=9148876)](https://coveralls.io/github/nikelborm/fetch-github-folder?branch=main)\n[![CodeFactor Code quality Grade](https://img.shields.io/codefactor/grade/github/nikelborm/fetch-github-folder?label=codefactor)](https://www.codefactor.io/repository/github/nikelborm/fetch-github-folder)\n[![Code Climate Technical Debt](https://img.shields.io/codeclimate/tech-debt/nikelborm/fetch-github-folder)](https://codeclimate.com/github/nikelborm/fetch-github-folder/issues)\n[![Code Climate Issues](https://img.shields.io/codeclimate/issues/nikelborm/fetch-github-folder)](https://codeclimate.com/github/nikelborm/fetch-github-folder/issues)\n[![GitHub Tests Workflow status](https://github.com/nikelborm/fetch-github-folder/actions/workflows/test.yml/badge.svg)](https://github.com/nikelborm/fetch-github-folder/actions/workflows/test.yml)\n[![GitHub Release Workflow status](https://github.com/nikelborm/fetch-github-folder/actions/workflows/release.yml/badge.svg)](https://github.com/nikelborm/fetch-github-folder/actions/workflows/release.yml)\n[![Sonar Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=nikelborm_fetch-github-folder\u0026metric=alert_status)](https://sonarcloud.io/summary/new_code?id=nikelborm_fetch-github-folder)\n[![Sonar Bugs Count](https://sonarcloud.io/api/project_badges/measure?project=nikelborm_fetch-github-folder\u0026metric=bugs)](https://sonarcloud.io/summary/new_code?id=nikelborm_fetch-github-folder)\n[![Sonar Code Smells Count](https://sonarcloud.io/api/project_badges/measure?project=nikelborm_fetch-github-folder\u0026metric=code_smells)](https://sonarcloud.io/summary/new_code?id=nikelborm_fetch-github-folder)\n[![Sonar Duplicated Lines (%)](https://sonarcloud.io/api/project_badges/measure?project=nikelborm_fetch-github-folder\u0026metric=duplicated_lines_density)](https://sonarcloud.io/summary/new_code?id=nikelborm_fetch-github-folder)\n[![Sonar Lines of Code Count](https://sonarcloud.io/api/project_badges/measure?project=nikelborm_fetch-github-folder\u0026metric=ncloc)](https://sonarcloud.io/summary/new_code?id=nikelborm_fetch-github-folder)\n[![Sonar Reliability Grade](https://sonarcloud.io/api/project_badges/measure?project=nikelborm_fetch-github-folder\u0026metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=nikelborm_fetch-github-folder)\n[![Sonar Security Grade](https://sonarcloud.io/api/project_badges/measure?project=nikelborm_fetch-github-folder\u0026metric=security_rating)](https://sonarcloud.io/summary/new_code?id=nikelborm_fetch-github-folder)\n[![Sonar Technical Debt Count](https://sonarcloud.io/api/project_badges/measure?project=nikelborm_fetch-github-folder\u0026metric=sqale_index)](https://sonarcloud.io/summary/new_code?id=nikelborm_fetch-github-folder)\n[![Sonar Maintainability Grade](https://sonarcloud.io/api/project_badges/measure?project=nikelborm_fetch-github-folder\u0026metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=nikelborm_fetch-github-folder)\n[![Sonar Vulnerabilities Count](https://sonarcloud.io/api/project_badges/measure?project=nikelborm_fetch-github-folder\u0026metric=vulnerabilities)](https://sonarcloud.io/summary/new_code?id=nikelborm_fetch-github-folder)\n![OSS Lifecycle status](https://img.shields.io/osslifecycle?file_url=https%3A%2F%2Fgithub.com%2Fnikelborm%2Ffetch-github-folder%2Fblob%2Fmain%2FOSSMETADATA)\n\n\u003c!-- Commented because there's some bug in effect library that prevents proper rendering of this badge --\u003e\n\u003c!-- [![npm minzipped bundle size](https://img.shields.io/bundlephobia/minzip/fetch-github-folder)](https://bundlephobia.com/package/fetch-github-folder) --\u003e\n\n\u003c!-- [![npms.io](https://img.shields.io/npms-io/final-score/fetch-github-folder)](update_link_later) --\u003e\n\u003c!-- [![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org) --\u003e\n\n\u003csup\u003e(Don't judge me for my obsession with badges)\u003c/sup\u003e\n\n\u003e [!CAUTION]\n\u003e\n\u003e This project currently is not stable, but I'm actively working on writing tests and handling edge cases, such as support for Git-LFS and other.\n\u003e Check out the `dev` branch to see the latest updates! 😉 (except that I currently don't care and just push to main)\n\n## What This Project Does\n\nThis project allows you to download any folder inside a repo on github.\n\n## Requirements\n\nYou need to have installed latest node, git, npm\n\n## Installation\n\n### From [default NPM registry](https://www.npmjs.com/package/fetch-github-folder)\n\n```bash\nnpm i fetch-github-folder\n```\n\n### From [JSR](https://jsr.io/@nikelborm/fetch-github-folder)\n\nUnfortunately JSR doesn't support publishing executables yet, so you can install only script library with functions that will allow you to fetch github folder from other scripts.\n\n```bash\nnpx jsr add @nikelborm/fetch-github-folder\n```\n\n### From [GitHub's NPM registry](https://github.com/nikelborm/fetch-github-folder/pkgs/npm/fetch-github-folder)\n\n1. [Generate `Personal access token (classic)` with `read:packages` scope](https://github.com/settings/tokens/new?description=Install%20packages%20from%20GitHub%20NPM%20registry\u0026scopes=read:packages\u0026default_expires_at=none)\n2. Save the token\n3. Login to Github's NPM registry (yes you need to do it, even if the package is public):\n\n   ```bash\n   npm login --scope=@nikelborm --auth-type=legacy --registry=https://npm.pkg.github.com\n   ```\n\n   You can also read more about `--auth-type=legacy` [here](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-npm-registry#authenticating-with-a-personal-access-token)\n\n4. Enter your username when asked\n5. Paste the token as password value\n6. Then install the package by executing:\n\n   ```bash\n   npm i @nikelborm/fetch-github-folder\n   ```\n\n### For local development\n\n```bash\n# Clone this repo:\ngit clone -b main https://github.com/nikelborm/fetch-github-folder.git\n# cd to it:\ncd fetch-github-folder\n# Install dependencies:\nnpm install\n# Create .env file:\ncp template.env .env\n# Ask for token\nread -sp 'Enter github access token: ' gh_token; echo;\n# And immediately put it into .env\nsed -i \"s/\\(GITHUB_ACCESS_TOKEN\\)='.*'/\\1='$gh_token'/\" .env\n```\n\n## Environment Variables\n\n- `GITHUB_ACCESS_TOKEN`: This is your personal access token from GitHub. It is used to authenticate your requests to the GitHub API. You can generate one [here](https://github.com/settings/tokens/new?description=Read%20repo%20contents%20access%20to%20fetch-github-folder\u0026scopes=public_repo\u0026default_expires_at=none).\n- `REPO_OWNER`: This is the username of the owner of the repository you are trying to download from. For example, if the repository's URL is `https://github.com/apache/superset`, the owner is `apache`.\n- `REPO_NAME`: This is the name of the repository you are trying to download from. In the example above, the repository name is `superset`.\n- `PATH_TO_ENTITY_IN_REPO`: This is the path to the directory you want to download. It can be directory that lies inside root of repo like `docker` or it can be some nested directory like `docker/nginx`.\n- `GIT_REF`: This is the commit SHA hash, branch name, or tag name you want to download from. If you don't specify it, the default branch in the repository will be used.\n- `DESTINATION_PATH`: If entity at `PATH_TO_ENTITY_IN_REPO` is a file, then destination path is a path to downloaded file. If it's a directory, then all files and directories from target directory of remote repository at `PATH_TO_ENTITY_IN_REPO` will be put into a directory with path from `DESTINATION_PATH`. If the directory doesn't exist, it will be automatically created.\n\n## How to use\n\n1. Set env variables in `.env` file\n2. Run `npm start`\n","funding_links":["https://github.com/sponsors/nikelborm"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikelborm%2Ffetch-github-folder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnikelborm%2Ffetch-github-folder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikelborm%2Ffetch-github-folder/lists"}