0.1.0 • Published 7 years ago
github-top v0.1.0
github-top
Install
yarn add github-top
Usage
const githubTop = require('github-top')
githubTop('2014-08-17'/* ← A date string */)
.then(data => {
// data: { topStarred: [], topNew: [], topStarredRepeated: [] }
})
data
{
// Top starred repos which were not previously featured in Changelog Nightly
topStarred: Array<Repo>,
// Top new repos which were open sourced on the day you specify
topNew: Array<Repo>,
// Top starred repos were previously featured in Changelog Nightly
topStarredRepeated: Array<Repo>
}
Repo
Type: object
Example:
{
repo: 'mozilla/send',
url: 'https://github.com/mozilla/send',
description: 'File Sharing Experiment',
// Total stars
stars: 1047,
// New stars since last day
growth: 453,
// The times it appeared in changelog nightly
timesListed: 2,
language: 'JavaScript'
}
Error handling
We're using axios under the hood, so you can handle http error like this:
githubTop()
.catch(err => {
if (err.response && err.response.status === 404) {
console.error('not found')
}
})
Contributing
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
Author
github-top © EGOIST, Released under the MIT License. Authored and maintained by EGOIST with help from contributors (list).
github.com/egoist · GitHub @EGOIST · Twitter @_egoistlily
0.1.0
7 years ago