Created
July 14, 2017 20:59
-
-
Save liddiard/5ca872ad2e20b57a31357701a384f7a7 to your computer and use it in GitHub Desktop.
Get a newline-separated list of a GitHub user's public repositories with repo title, GitHub URL, and description.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const request = require('superagent'); | |
const username = 'liddiard'; // change username as needed | |
request | |
.get(`https://api.github.com/users/${username}/repos`) | |
.query({page: 1}) // increment this page number as needed | |
.then(res => | |
fs.appendFile('repos.txt', res.body.map(repo => | |
[repo.name, repo.html_url, repo.description].join('\n')) | |
.join('\n\n') + '\n')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment