{"id":20651764,"url":"https://github.com/openblockcc/openblock-github-download","last_synced_at":"2025-03-09T20:59:41.489Z","repository":{"id":57315253,"uuid":"357397921","full_name":"openblockcc/openblock-github-download","owner":"openblockcc","description":"Easily download Github repos without dependencies such as Git, Tar, Unzip, etc.","archived":false,"fork":false,"pushed_at":"2021-04-13T06:58:05.000Z","size":43,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-03-23T08:21:02.551Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/openblockcc.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-04-13T02:17:16.000Z","updated_at":"2021-06-25T02:59:17.000Z","dependencies_parsed_at":"2022-09-12T15:01:52.419Z","dependency_job_id":null,"html_url":"https://github.com/openblockcc/openblock-github-download","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openblockcc%2Fopenblock-github-download","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openblockcc%2Fopenblock-github-download/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openblockcc%2Fopenblock-github-download/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openblockcc%2Fopenblock-github-download/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openblockcc","download_url":"https://codeload.github.com/openblockcc/openblock-github-download/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242750785,"owners_count":20179257,"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","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":[],"created_at":"2024-11-16T17:29:27.250Z","updated_at":"2025-03-09T20:59:41.458Z","avatar_url":"https://github.com/openblockcc.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Node.js - github-download\n================\n\n[![build status](https://travis-ci.com/openblockcc/openblock-github-download.svg?branch=main)](https://travis-ci.com/openblockcc/openblock-github-download.svg?branch=main)\n\nEasily download Github repos without any external dependencies such as Git, Tar, Unzip, etc.\n\n\nWhy?\n----\n\nI really like the concept of managing user defined projects, repos, file structures (package management) on Github like the way that [Component](https://github.com/component) does package management. I have a package management system [Rock](https://github.com/rocktemplates) that I use to create skeleton/templates of projects. I wanted Rock to use Github as a package management system. I also didn't want any dependencies amongst any 3rd party programs like Git, Tar, or Unzip. Pure Node.js JavaScript is what I wanted.\n\n\nInstallation\n------------\n\n    npm install openblock-github-dl\n\n\n\nUsage\n-----\n\n### ghdownload(params, dir)\n\nDownloads the latest copy of some Github reference (branch, tag, or commit), or the `master` branch by default (specifically the `master` branch, it does _not_ honor Github's default branch configuration). This will still work even if the Github API limit has been reached.\n\n- **params**: Can either be:\n     - a Github URL string such as:\n         - `https://github.com/jprichardson/node-vcsurl.git`\n         - `git@github.com:jprichardson/node-vcsurl.git`\n         - `git://github.com/jprichardson/node-vcsurl.git`\n         - and even including a reference, e.g. `https://github.com/jprichardson/node-vcsurl.git#master`\n     - or an object like so: `{user: 'jprichardson', repo: 'vcsurl', ref: 'master'}`\n- **dir**: The output directory. Uses the current working directory if nothing is specified.\n\nReturns a GithubDownloader object that emits events on `dir`, `file`, and `end`.\n\nExample:\n\n```javascript\nvar ghdownload = require('github-download')\n  , exec = require('exec')\n\nghdownload({user: 'jprichardson', repo: 'node-batchflow', ref: 'master'}, process.cwd())\n.on('dir', function(dir) {\n  console.log(dir)\n})\n.on('file', function(file) {\n  console.log(file)\n})\n.on('zip', function(zipUrl) { //only emitted if Github API limit is reached and the zip file is downloaded\n  console.log(zipUrl)\n})\n.on('error', function(err) {\n  console.error(err)\n})\n.on('end', function() {\n  exec('tree', function(err, stdout, sderr) {\n    console.log(stdout)\n  })\n})\n```\n\nOutputs:\n\n    .\n    ├── CHANGELOG.md\n    ├── LICENSE\n    ├── README.md\n    ├── lib\n    │   └── batchflow.js\n    ├── package.json\n    └── test\n        ├── batchflow-par-array.test.js\n        ├── batchflow-par-limit.test.js\n        ├── batchflow-par-object.test.js\n        ├── batchflow-seq-array.test.js\n        ├── batchflow-seq-object.test.js\n        ├── batchflow.test.js\n        ├── mocha.opts\n        └── resources\n\n    3 directories, 12 files\n\n\n\nLicense\n-------\n\n(MIT License)\n\nCopyright 2013-2016, JP Richardson  \u003cjprichardson@gmail.com\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenblockcc%2Fopenblock-github-download","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenblockcc%2Fopenblock-github-download","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenblockcc%2Fopenblock-github-download/lists"}