Easily download Github repos without any external dependencies such as Git, Tar, Unzip, etc.

npm install github-download
3 downloads in the last week
26 downloads in the last month

Node.js - github-download

build status

Easily download Github repos without any external dependencies such as Git, Tar, Unzip, etc.


I really like the concept of managing user defined projects, repos, file structures (package management) on Github like the way that Component does package management. I have a package management system Rock 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.


npm install github-download


ghdownload(params, dir)

Downloads the latest copy of the master branch. This will still work even if the Github API limit has been reached.

  • params: Can either be a Github URL string such as:,, or git:// It can also be an object containing like so: {user: 'jprichardson', repo: 'vcsurl'}.
  • dir: The output directory. Uses the current working directory if nothing is specified.

Returns a GithubDownloader object that emits events on dir, file, and end.


var ghdownload = require('github-download')
  , exec = require('exec')

ghdownload({user: 'jprichardson', repo: 'node-batchflow'}, process.cwd())
.on('dir', function(dir) {
.on('file', function(file) {
.on('zip', function(zipUrl) { //only emitted if Github API limit is reached and the zip file is downloaded
.on('error', function(err) {
.on('end', function() {
  exec('tree', function(err, stdout, sderr) {


├── lib
│   └── batchflow.js
├── package.json
└── test
    ├── batchflow-par-array.test.js
    ├── batchflow-par-limit.test.js
    ├── batchflow-par-object.test.js
    ├── batchflow-seq-array.test.js
    ├── batchflow-seq-object.test.js
    ├── batchflow.test.js
    ├── mocha.opts
    └── resources

3 directories, 12 files


(MIT License)

Copyright 2013, JP Richardson

npm loves you