node-github.js

1.0.10 • Public • Published

node-github.js

NPM version NPM downloads circleci

A simple node.js wrapper for the Github API V3 npm installnfo

  • 📦 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.

Package Sidebar

Install

npm i node-github.js

Weekly Downloads

1

Version

1.0.10

License

MIT

Unpacked Size

11.4 kB

Total Files

7

Last publish

Collaborators

  • syncx