{"id":22488935,"url":"https://github.com/tr1ckydev/fetchgit","last_synced_at":"2025-10-06T20:11:34.742Z","repository":{"id":204871401,"uuid":"712381294","full_name":"tr1ckydev/fetchgit","owner":"tr1ckydev","description":"Easily download files and directories from a GitHub repository.","archived":false,"fork":false,"pushed_at":"2024-02-21T20:10:44.000Z","size":6,"stargazers_count":15,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-13T08:07:46.155Z","etag":null,"topics":["download","fetch","github"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/fetchgit","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/tr1ckydev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-31T11:06:50.000Z","updated_at":"2025-05-13T16:45:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"9ab47650-2ac9-46a0-8a74-900469644367","html_url":"https://github.com/tr1ckydev/fetchgit","commit_stats":{"total_commits":3,"total_committers":1,"mean_commits":3.0,"dds":0.0,"last_synced_commit":"c6f2c49b10a7c445f311b9e27b8a21d788f34955"},"previous_names":["tr1ckydev/fetchgit","tr1ckydev/gitfetch","tr1ckydev/githubfetch"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tr1ckydev/fetchgit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tr1ckydev%2Ffetchgit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tr1ckydev%2Ffetchgit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tr1ckydev%2Ffetchgit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tr1ckydev%2Ffetchgit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tr1ckydev","download_url":"https://codeload.github.com/tr1ckydev/fetchgit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tr1ckydev%2Ffetchgit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278671773,"owners_count":26025752,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["download","fetch","github"],"created_at":"2024-12-06T17:18:56.471Z","updated_at":"2025-10-06T20:11:34.723Z","avatar_url":"https://github.com/tr1ckydev.png","language":"TypeScript","readme":"# fetchgit\nEasily download files and directories from a GitHub repository.\n\n- Works in Node.JS, Bun and Deno.\n- Uses fastest runtime specific APIs to write files.\n- Faster than `git clone` for smaller repositories.\n\n\n\n### Fetching a specific directory from a repository\n\nRecursively fetches the directory for all the files and subdirectories inside.\n\n```ts\nimport { fetchDirectory } from \"fetchgit\";\n\nawait fetchDirectory({\n    repo: \"chalk/chalk\",\n    path: \"source/vendor/supports-color\",\n    destination: \"./chalk\"\n});\n```\n\nSet `basedir_only` to `true` if you only want to create the directory without the parent sub-directories of path.\n\n\n\n### Fetching an entire repository\n\nIf `path` isn't provided, it will fetch the entire repository.\n\n```ts\nimport { fetchDirectory } from \"fetchgit\";\n\nawait fetchDirectory({\n    repo: \"tr1ckydev/hyperimport\",\n    destination: \"./hyperimport\"\n});\n```\n\n\u003e **NOTE**\n\u003e\n\u003e If the repository is small (i.e. has less number of files), it can be faster than `git clone` in most cases but will take way too much time for larger repositories.\n\n\n\n### Fetching a single file from a repository\n\n*(Requires destination directory to be created already.)*\n\n```ts\nimport { fetchFile } from \"fetchgit\";\n\nawait fetchFile({\n    repo: \"oven-sh/bun\",\n    path: \"README.md\",\n    branch: \"main\",\n    destination: \"./temp\"\n});\n```\n\nIf `branch` isn't provided, the default branch name of the repository is fetched and then the file.\n\n\u003e **NOTE**\n\u003e\n\u003e Explicitly mentioning the branch name will skip the above step, making it faster to fetch the file.\n\n\n\n## License\n\nThis repository uses MIT license. See [LICENSE](https://github.com/tr1ckydev/fetchgit/blob/main/LICENSE) for full license text.\n","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftr1ckydev%2Ffetchgit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftr1ckydev%2Ffetchgit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftr1ckydev%2Ffetchgit/lists"}