1.0.1 • Published 4 years ago

github-trends-api v1.0.1

Weekly downloads
23
License
MIT
Repository
github
Last release
4 years ago

Github trends api

Unofficial Github Trending API

npm version

npm i github-trends-api
// or
yarn add github-trends-api

Usage

const githubTrends = require('github-trends-api')
// or
import githubTrends from 'github-trends-api';

Methods

const options = {
  section?: '', // default: empty (repositories) - or 'developers'
  language?: '' // default: empty (all) - or 'javascript', 'java' etc..
  since?: '' // default: empty (daily) - or 'weekly', 'monthly'
  spoken_language_code?: '' // default: empty (all) - or en - fs - zh ...
}

githubTrends(options: Object): Promise

Examples

Repositories

githubTrends()
  .then(result => { console.log(result) })
  .catch(error => { console.log(error) })
  • Response
[
  {
    "author": "CSSEGISandData",
    "reponame": "COVID-19",
    "repourl": "https://github.com//CSSEGISandData/COVID-19",
    "repodesc": "Novel Coronavirus (COVID-19) Cases, provided by JHU CSSE",
    "language": "",
    "langcolor": "",
    "stars": 3,
    "forks": 303,
    "laststars": 1,
    "builtby": [
      {
        "username": "CSSEGISandData",
        "url": "https://github.com/CSSEGISandData",
        "avatar": "https://avatars3.githubusercontent.com/u/60674295?s=40&v=4"
      }
    ]
  }
]

Developers

githubTrends({ section: 'developers', since: 'weekly' })
  .then(result => { console.log(result) })
  .catch(error => { console.log(error) })
  • Response
[
  {
    "author": "James Montemagno",
    "username": "jamesmontemagno",
    "avatar": "https://avatars3.githubusercontent.com/u/1676321?s=96&v=4",
    "url": "https://github.com/jamesmontemagno",
    "reponame": "Xamarin.Plugins",
    "repourl": "https://github.com/jamesmontemagno/Xamarin.Plugins",
    "description": "Cross platform xamarin and windows plugins for PCLs"
  }
..]

Tests

https://npm.runkit.com/github-trends-api

License

MIT

1.0.1

4 years ago

1.0.0

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago