github-basic-api
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

github-basic-api

This package simplifies fetching data from GitHub by providing functions for the following tasks:

User Information

  • Get details of a specific user by username.
  • Get a random user from GitHub.

Repositories

  • Get a list of a user's public repositories.
  • Get details of a specific repository by owner and repo name.
  • Get a random public repository from GitHub.

Installation

npm i github-basic-api

Usage

import {getRepoDetails, getRandomRepos, searchRepos, getUser, getRandomUsers} from 'github-basic-api';

// returns a repo detail
console.log(await getRepoDetails('Kolosafo', 'github-api')); //params: Repo owner and repo name

// returns an array of random github repositories
console.log(await getRandomRepos());

// returns an array of matching github repositories
console.log(await searchRepos('github-api')); //param: repo name

// returns a user's profile details
console.log(await getRandomUsers());

// returns an array of random github users
console.log(await getUser('Kolosafo')); //param: github username

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

Package Sidebar

Install

npm i github-basic-api

Weekly Downloads

3

Version

1.0.1

License

MIT

Unpacked Size

9.02 kB

Total Files

7

Last publish

Collaborators

  • kolosafo