0.1.0 • Published 7 years ago

github-top v0.1.0

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

github-top

NPM version NPM downloads CircleCI donate chat

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

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. 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