1.2.0 • Published 1 year ago

github-user-data v1.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Documentation for github-user-data

The purpose of this code is to make a simple GitHub API wrapper and help user retrieve valuable information.

Installation

npm install github-user-data

Dependencies

This code requires the following dependencies:

  1. axios
  2. log-symbols

GithubUserData Function

Parameters

  1. username (required): the GitHub username of the user to retrieve information for
  2. option (optional): a string indicating the type of user information to retrieve. If this parameter is not provided, all available user information will be returned. This parameter is case-insensitive.

Returned. Possible options are:

  1. login
  2. id
  3. node_id
  4. avatar_url
  5. gravatar_id
  6. url
  7. type
  8. site_admin
  9. name
  10. company
  11. blog
  12. location
  13. email
  14. hireable
  15. bio
  16. twitter_username
  17. public_repos
  18. public_gists
  19. followers
  20. following
  21. created_at
  22. updated_at
  23. all - (returns all personal information)

Example

import { GithubUserData } from "github-user-data";

async function main() {
  const username = "octocat";
  const option = "location";
  const userData = await GithubUserData(username, option);
  console.log(userData);
}

main();

// Outputs { 'San Francisco' }

CountStars Function

Parameters

  1. username (required): the GitHub username of the user to count stars for

Example

import { CountStars } from "github-user-data";

async function main() {
  const username = "octocat";
  const stars = await CountStars(username);
  console.log(stars);
}

main();

// Status as of 3/29/2023 Outputs { 15044 }

GetNamesOfAllRepos Function

Parameters

  1. username (required): the GitHub username of the user, all of his public repositories will be saved in array

Example

import { GetNamesOfAllRepos } from "github-user-data";

async function main() {
  const username = "octocat";
  const names = await GetNamesOfAllRepos(username);
  console.log(names);
  console.log(names.length);
}

main();

/* 
Status as of 4/11/2023 Outputs:

[
  'boysenberry-repo-1',
  'git-consortium',
  'hello-worId',
  'Hello-World',
  'linguist',
  'octocat.github.io',
  'Spoon-Knife',
  'test-repo1'
] 

8

*/

License

This package is licensed under the MIT License.

1.2.0

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago