An open API service indexing awesome lists of open source software.

https://github.com/stynh/githubpinnedrepos.js

A simple Javascript extension to fetch pinned repositories from a Github profile.
https://github.com/stynh/githubpinnedrepos.js

api github javascript repository

Last synced: about 2 months ago
JSON representation

A simple Javascript extension to fetch pinned repositories from a Github profile.

Awesome Lists containing this project

README

          

# GithubPinnedRepos.js
[![npm version](https://badge.fury.io/js/githubpinnedrepos.svg)](https://badge.fury.io/js/githubpinnedrepos)
![npm](https://img.shields.io/npm/dt/githubpinnedrepos)
![npm bundle size](https://img.shields.io/bundlephobia/min/githubpinnedrepos)

A simple Javascript extension to fetch pinned repositories from a Github profile.

## Usage
You will need a [Github Personal Access Token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) that has access to **read:user**.

### Example
```html

function printRepos(repos){
console.log(repos);
}

window.GithubPinnedRepos.getPinnedRepos(*YourGithubUsername*, *YourPersonalAccessToken*, printRepos);

```
**Example Output**
```json
{
"itemsRemaining": 0,
"totalPinnedRepos": 6,
"pinnedRepos": [
{
"name": "CrossWars-2",
"url": "https://github.com/StynVanDeHaterd/CrossWars-2",
"primaryLanguage": "C"
},
{
"name": "B2Engine",
"url": "https://github.com/StynVanDeHaterd/B2Engine",
"primaryLanguage": "C"
},
{
"name": "CrossWars",
"url": "https://github.com/StynVanDeHaterd/CrossWars",
"primaryLanguage": "C++"
},
{
"name": "floatygons.js",
"url": "https://github.com/StynVanDeHaterd/floatygons.js",
"primaryLanguage": "JavaScript"
},
{
"name": "textygons.js",
"url": "https://github.com/StynVanDeHaterd/textygons.js",
"primaryLanguage": "TypeScript"
},
{
"name": "texterfall.js",
"url": "https://github.com/StynVanDeHaterd/texterfall.js",
"primaryLanguage": "TypeScript"
}
]
}
```