Created
March 17, 2018 04:19
-
-
Save jdx/c0489602cfa7b0a4d74e707731419357 to your computer and use it in GitHub Desktop.
This file contains 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
import {Command} from '@oclif/command' | |
import axios from 'axios' | |
export default class Stars extends Command { | |
static description = 'show the github stars on a repository' | |
static args = [{name: 'repository', required: true}] | |
async run() { | |
const {args} = this.parse(Stars) | |
const {data: stargazers} = await axios.get(`https://api.github.com/repos/${args.repository}/stargazers`) | |
for (let s of stargazers) { | |
this.log(s.login) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment