Package Exports
- octo-connect
- octo-connect/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (octo-connect) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
📦 octo-connect
A simple, powerful Node.js wrapper around the GitHub REST API. Easily fetch user and repository details including profiles, followers, repos, issues, README content, contributors, branches, and more — with support for authentication and pagination.
🚀 Features
- ✅ Fetch GitHub user profiles
- ✅ List repositories, followers, and following
- ✅ View repo-specific data (issues, README, contributors, branches)
- ✅ Filter repos by programming language
- ✅ Search users by location
- ✅ Supports GitHub tokens (for extended rate limits)
- ✅ Built-in pagination support
📦 Installation
npm install octo-connect
Usages
import { gitDetails } from "octo-connect";
// Without GitHub token (rate-limited to 60 requests/hour)
const userClass = new gitDetails("santoshrazz");
// OR with GitHub token (up to 5,000 requests/hour)
const userClass = new gitDetails("santoshrazz", "your_github_token_here");
async function testGitDetails() {
try {
const user = await userClass.getUser();
console.log("User Details:", user);
const repos = await userClass.getRepos(1, 10); // optional : page 1, 10 repos
console.log("Repositories:", repos);
const followers = await userClass.getFollowers(1, 10);
console.log("Followers:", followers);
const following = await userClass.getFollowing(1, 10);
console.log("Following:", following);
const repoName = "santosh-portfolio";
const repoDetails = await userClass.repoDetails(repoName);
console.log("Repository Details:", repoDetails);
const readme = await userClass.getRepoReadme(repoName);
console.log("Repository Readme:", readme);
const issues = await userClass.getRepoIssues(repoName, 1, 5);
console.log("Repository Issues:", issues);
const contributors = await userClass.getRepoContributors(repoName, 1, 5);
console.log("Repository Contributors:", contributors);
const branches = await userClass.getRepoBranches(repoName, 1, 5);
console.log("Repository Branches:", branches);
const locationUsers = await userClass.getUserByLocation(
"San Francisco",
1,
5
);
console.log("Users in San Francisco:", locationUsers);
const jsRepos = await userClass.getReposByLanguage("JavaScript", 1, 5);
console.log("Top JavaScript Repos:", jsRepos);
} catch (error) {
console.error("❌ Error:", error.message);
}
}
testGitDetails();
Method | Description |
---|---|
getUser() |
Fetch GitHub user profile |
getRepos(page, per_page) |
List repositories |
getFollowers(page, per_page) |
List followers |
getFollowing(page, per_page) |
List following |
repoDetails(repoName) |
Get repository metadata |
getRepoReadme(repoName) |
Get README content |
getRepoIssues(repoName, page, per_page) |
Get open issues |
getRepoContributors(repoName, page, per_page) |
Get contributors |
getRepoBranches(repoName, page, per_page) |
Get repo branches |