Skip to content

Instantly share code, notes, and snippets.

@creationix
Created September 15, 2011 18:00
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save creationix/1219978 to your computer and use it in GitHub Desktop.
Save creationix/1219978 to your computer and use it in GitHub Desktop.
Script to download all repos for a user
// Run this with node and then run the output with sh
var Http = require('http')
var ChildProcess = require('child_process');
Http.cat("http://github.com/api/v2/json/repos/show/creationix", function (err, json) {
if (err) throw err;
var data = JSON.parse(json);
data.repositories.forEach(function (repo) {
console.log("echo " + JSON.stringify(repo.name + " - " + repo.description));
console.log("git clone --bare " + repo.url);
});
});
@dipenparmar12
Copy link

It throws Error--

Http.cat("http://github.com/api/v2/json/repos/show/creationix", function (err, j
son) {
^

TypeError: Http.cat is not a function
at Object. (F:\test\git.js:4:6)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)

@tecno14
Copy link

tecno14 commented Oct 18, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment