New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

github-contributions-counter

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github-contributions-counter

A simple Javascript API that will return the public github contributions history for a user based on a universal function

  • 2.0.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
107
decreased by-45.41%
Maintainers
1
Weekly downloads
 
Created
Source

github-contributions-counter

A simple Javascript API that will return the public Github contributions history for a user based on a universal function

githhub-contributions-counter


version


A Quick Note 👀

This was not designed in affiliation with Github, Getting contribution history is not part of their API as of the creation of this package. It essentially scrapes information from a Github profile. All within the browser!

Getting Started

Install

Via NPM

npm i github-contributions-counter

Via Yarn

yarn add github-contributions-counter

Demo

Demo App

Usage

import { getGithubContributions } from 'github-contributions-counter'
// can use a commonjs require as well
/**
 *  Can also be used with await
 */
getGithubContributions({
  username: 'github_username',
  config: { partition: 'current' }
}).then((r) => {
  console.log(r)
})

API

Interface

ParameterDescriptionStatusType
usernameA valid github username. Organization names are not currently supportedRequiredstring
configA optional configuration object named config that accepts an optional partition type, an optional proxy and optional logs.OptionalObject

Config

An optional config object can be added as a second parameter to customize behavior.

KeyDescriptionDefault ValueType
proxyA string proxy url. Since data is being scraped from within the browser a proxy is required to handle CORS errors. If no proxy is required a fallback proxy is used. However it is intentionally rate limited to 50 calls every 30 seconds. For this reason, the usage of a custom proxy is recommended. You can follow this example to quickly standup your own CORS proxy.nullstring
partitionA string partition to upon which to categorize data. - "year": Group contributions by year. - "all": The Sum of all contributions for that user since account creation. - "current": The Current default contributions displayed on the user's Github Profile (the past 365 days)."all"string
logsA string log level that can be specified for log levels. - "error:: Throw an Error whenever a failure is detected - "warning": Log warnings in the console but do not throw an error - "none": Do not throw any errors or log anything to the console"none"string

Issue Tracker

Issues

Contributing

Contributions are welcomed and encouraged! Refer to Contribution Guidelines

Development

  1. Clone
git clone git@github.com:SammyRobensParadise/github-contributions-counter.git
  1. Install
npm install
# or
yarn install
  1. Develop 💻

  2. Build using rollup.js

npm run build
# or
yarn run build

Info

Author: Sammy Robens-Paradise. sammy.world

Keywords

FAQs

Package last updated on 09 May 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc