npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

github-user-contribution-summary

v0.0.10

Published

A library with utilities to get the GitHub user contribution summary by username.

Downloads

11

Readme

Github User Contribution Summary

To get your personal access token you can refer this guide creating-a-personal-access-token

Installation

npm install github-user-contribution-summary

#OR

yarn add github-user-contribution-summary

Usage

With ES6

ContributionSummary

import { getContributionSummary } from 'github-user-contribution-summary';

const getUserContributionSummary = async () => {

  const argument = {
    userName: 'Sachin-chaurasiya',
    githubToken: '',
  };

  try {
    const response = await getContributionSummary(
      argument
    );
    console.log(response);
  } catch (error) {
    console.log('Something went wrong', error);
  }
};

getUserContributionSummary();

// Output

{
    "totalContributionCount": 3287,
    "contributionByDate": [
        {
            "contributionCount": 5,
            "date": "2022-11-18"
        },
        ...
     ],
    "totalPullRequests": 705,
    "totalIssues": 316,
    "totalStarredRepositories": 171,
    "totalRepositoriesContributedTo": 31,
    "totalRepositories": 60,
    "totalGists": 3,
    "totalFollowers": 63,
    "totalPullRequestReviewed": 604
}

Pull Request Count

import { getPullRequestCountByState } from 'github-user-contribution-summary'

const getPullRequestCount = async () => {
  try {
    const data = await getPullRequestCountByState(
      {
        userName: 'Sachin-chaurasiya',
        githubToken: '',
      },
      'MERGED'
    );

    console.log(data);
  } catch (error) {
    console.log('error', error);
  }
};

getPullRequestCount();

// Output

{ state: 'MERGED', count: 671 }

Issue Count

import { getIssueCountByState } from 'github-user-contribution-summary'

const getIssueCount = async () => {
  try {
    const data = await getIssueCountByState(
      {
        userName: 'Sachin-chaurasiya',
        githubToken: '',
      },
      'CLOSED'
    );

    console.log(data);
  } catch (error) {
    console.log('error', error);
  }
};

getIssueCount();

// Output

{ state: 'CLOSED', count: 301 }

With CommonJs

ContributionSummary

const  { getContributionSummary } = require('github-user-contribution-summary');

const getUserContributionSummary = async () => {

  const argument = {
    userName: 'Sachin-chaurasiya',
    githubToken: '',
  };

  try {
    const response = await getContributionSummary(
      argument
    );
    console.log(response);
  } catch (error) {
    console.log('Something went wrong', error);
  }
};

getUserContributionSummary();

// Output

{
    "totalContributionCount": 3287,
    "contributionByDate": [
        {
            "contributionCount": 5,
            "date": "2022-11-18"
        },
        ...
     ],
    "totalPullRequests": 705,
    "totalIssues": 316,
    "totalStarredRepositories": 171,
    "totalRepositoriesContributedTo": 31,
    "totalRepositories": 60,
    "totalGists": 3,
    "totalFollowers": 63,
    "totalPullRequestReviewed": 604
}

How to Set up github-user-contribution-summary for Development?

Before starting, please check the Contribution Guide to get started.

Fork and Clone the Repo

First, you need to fork the github-user-contribution-summary repo. You can do this by clicking the Fork button on the top right corner of the repo. If you are new to forking, please watch this YouTube Guide to get started.

Once forked, you can clone the repo by clicking the Clone or Download button on the top right corner of the forked repo.

Please change the directory after cloning the repository using the cd <folder-name> command.

Install Dependencies

Next, install the dependencies by running the following command in the github-user-contribution-summary repo:

npm install

Or

yarn install

Build the package

Use the following command to build the package:

npm run build

Or

yarn build

It builds the package for production to the lib folder.

Contributors

We value all contributions, no matter their size! To get started, please refer to our CONTRIBUTING guide, and don't hesitate to reach out to us for any assistance you may need.

If you don't want to miss any updates, please show your support by giving the project a ⭐ 🚀.

We extend a massive THANK YOU to all our supporters!

Stargazers repo roster for @Sachin-chaurasiya/github-user-contribution-summary