node-github.js
📦 Lightweight: Modular to the core. Less then 200 lines of clean and optimized code.🔰 Simplistic: Build to be beginner friendly, to suit everyone's needs.
Installation
npm install node-github.js --save
Dependencies
It depends on axios as a main dependency and moment to parse the date/time returned by the data.
npm install
Declaration
const GithubClient = require("node-github.js");
const client = new GithubClient();
Usage
The methods return a Promise. You can resolve it using .then()
to get the results.
client.getUser("Sync-Codes").then((data) => console.log(data)); // returns a user object with the data
Result Data
{
username: 'Sync-Codes',
avatar: 'https://avatars.githubusercontent.com/u/37131433?v=4',
name: 'Bhavya Dang',
bio: 'Web Developer and Designer',
website: 'https://synxc.carrd.co/',
followers: 11,
following: 25,
createdAt: 'Mar 7th, 2018',
location: 'India',
total_public_repos: 45,
total_private_repos: 'None'
}
Other Methods
.getUserRepo(para)
Returns a repo object with the Repositiory data of the username passed as para
.
.getUserOrgs(para)
Returns a orgs object with the Organization data of the username passed as para
.
.searchUsers(query)
Returns an object containing the best match results of the user. Filtered by the query
parameter passed.
.searchTopics(query)
Returns an object containing the best match results of the topic. Filtered by the query
. The topic is always a featured topic.
Contact
You can contact me on my Discord (Sync#9069).
Issues
Found an issue? Open up an issue here!
License
© Sync-Codes, 2020 Released under MIT License.