1.1.1 • Published 6 months ago

repo-finder v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

repo-finder

Gets user and repo info for a specified GitHub user, using the GitHub API.

  • User info is gotten from https://api.github.com/users/USERNAME
  • User repos are gotten from https://api.github.com/users/USERNAME/repos

Installation

Using npm

$ npm install repo-finder

Using yarn

$ yarn add repo-finder

Using pnpm

$ pnpm add repo-finder

Using bun

$ bun i repo-finder

Usage

Once the package is installed, you can import it in your code using both require or import depending on whether you use CommonJS or ESModules.

import { getUserData, getUserRepos } from "repo-finder";

const { getUserData, getUserRepos } = require("repo-finder");

Both functions return a promise containing the raw JSON data from the GitHub API. You can then format that data however you like.

Example

const { getUserRepos } = require("repo-finder");

const data = getUserRepos(username);

data.then((repos) => {
  console.log("Total repos: " + repos.length);

  repos.forEach((repo) => {
    console.log(repo.name);
  });
});

Note: getUserRepos and getUserData implement async/await which is part of ES2017 and is not supported by some older browsers.

1.1.1

6 months ago

1.1.0

6 months ago

1.0.6

6 months ago

1.0.5

6 months ago

1.0.4

6 months ago

1.0.3

6 months ago

1.0.2

6 months ago

1.0.1

6 months ago

1.0.0

6 months ago