Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

git-activity-stats

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

git-activity-stats

Grab an contributions calendar from a github profil page and extact stats from it

  • 0.0.3
  • latest
  • Source
  • npm
  • Socket score

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

git-activity-stats

Grab an Github contributions calendar and extact stats from it. Based on GithubStats

## Features

Extract :

  • Contributions calendar
  • Max number of commit per day
  • Mean
  • All streaks
  • Max streak(s)
  • Current streak
  • Quartiles boundaries

Installation

npm install git-activity-stats

Usage

let gitactivitystats = require('git-activity-stats');

gitactivitystats.getContributions('valcol', function(error, contrib){

  // Contributions array, day as index, number of commit as value
  let contributions = contrib.contributions;
  //First date of the contributions calendar
  let startDate = contrib.startDate;

  //Max. number of contributions per day
  let max = gitactivitystats.getMax(contributions);

  //Mean of the contributions
  let mean = gitactivitystats.getMean(contributions);

  //All streaks
  let streaks = gitactivitystats.getStreaks(contributions, startDate);
  for (let i=0;i<streaks.length;i++){
    console.log("Start date : "+streaks[i].startDate);
    console.log("End date : "+streaks[i].endDate);
    console.log("Duration : "+streaks[i].length);
  }

  //The longest streak(s)
  let maxStreaks = gitactivitystats.getMaxStreak(contributions);

  //Current streak
  let currentStreak = gitactivitystats.getCurrentStreak(contributions);

  //Get quartile boundaries, with the index as the quartile number
  //and the value as the upper bound of the quartile (inclusive)
  let quartileBoundaries = gitactivitystats.getQuartileBoundaries(contributions);

});

Tests

npm test

License

git-actitity-stats is released under the MIT License.

Keywords

FAQs

Package last updated on 22 Oct 2016

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