Get the stars for one or more GitHub users or organizations.
Follow this project's author, Jon Schlinkert, for updates on this project and others.
Install with npm:
$ npm install --save gh-stars
Params
names
{String|Array}: One or more GitHub user or organization names.options
{Options}returns
{Promise}
Example
var stars = require('gh-stars');
stars(['doowb', 'jonschlinkert'], {token: 'YOUR_GITHUB_AUTH_TOKEN'})
.then(function(res) {
console.log(res);
})
.catch(console.error)
Type: String|Function
Default: API defaults to json
, CLI defaults to markdown
.
Description
The format to use for the returned report. A custom function may be defined, or optionally choose one of the available formats:
json
- this is the default when used by APImarkdown
(ormd
) - returns a markdown table, this is the default when used by CLIraw
- no formatting is applied
Example
var stars = require('gh-stars');
stars(['doowb', 'jonschlinkert'], {token: 'YOUR_GITHUB_AUTH_TOKEN', format: 'md'})
.then(function(res) {
// res would be formatted as markdown
console.log(res);
})
.catch(console.error)
Type: Function
Default: Filters out private repositories and forks by default.
Description: Custom function to filter out repositories from the result.
Example
var stars = require('gh-stars');
stars(['doowb', 'jonschlinkert'], {
token: 'YOUR_GITHUB_AUTH_TOKEN',
filter: function(repo) {
return repo.name !== 'foo';
}
})
.then(function(res) {
// res would be formatted as markdown
console.log(res);
})
.catch(console.error)
$ stars <names> <dest> [options]
names
- one or more comma-separated user names or orgsdest
- destination path to use, default isstars.md
Options
--format
- the format to use.
This is a small cross-section of stars for @doowb's repos:
| **Stars** | **Name** |
| --- | --- |
| 3408 | assemble |
| 1410 | handlebars-helpers |
| 364 | verb |
| 309 | micromatch |
| 5491 | TOTAL |
You might also be interested in these projects:
- gists: Methods for working with the GitHub Gist API. Node.js/JavaScript | homepage
- github-base: JavaScript wrapper that greatly simplifies working with GitHub's API. | homepage
- repos: List all repositories for one or more users or orgs. | homepage
- topics: Get and update GitHub repository topics. | homepage
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Please read the contributing guide for advice on opening issues, pull requests, and coding standards.
(This project's readme.md is generated by verb, please don't edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)
To generate the readme, run the following command:
$ npm install -g verbose/verb#dev verb-generate-readme && verb
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
$ npm install && npm test
Jon Schlinkert
Copyright © 2017, Jon Schlinkert. Released under the MIT License.
This file was generated by verb-generate-readme, v0.6.0, on September 12, 2017.