Socket
Socket
Sign inDemoInstall

git-commit-statistics

Package Overview
Dependencies
1
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    git-commit-statistics

Get commits statistics about git repository


Version published
Weekly downloads
2
Maintainers
1
Install size
254 kB
Created
Weekly downloads
 

Readme

Source

git-commit-statistics

NPM version Build Status Coverage Status

Get commits statistics about git repository.

Features

Get belows statistics. Example is here.

  • byPerDayOfMonth
  • byPerMonth
  • byPerWeekDays
  • byPerYear
  • byPerDayHour

Installation

$ npm install git-commit-statistics

Usaga

const CommitStatistics = require('git-commit-statistics');

const cs = new CommitStatistics('<yourRepositoryPath>/.git');
let result = cs.getByPerDayOfMonth();

//With options
const options = {
  author: 'YoshinoriN',
  since: '2017-01-01',
  after: '2018-01-01',
  n: 100,
  noMerges: true
};
let result = cs.getByPerDayOfMonth(options);

All available methods are belows.

nameoptionsresult
getByPerDayOfMonth()Optionsexample
getByPerMonth()Optionsexample
getByPerWeekDay()Optionsexample
getByPerYear()Optionsexample
getByDayHour()Optionsexample

Options

Allowable options for each methods argument. Please see official git document.

nametypeexample
authorstring'YoshinoriN'
sincestring'2017-01-01'
afterstring'2018-01-01'
untilstring'2018-01-01'
beforestring'2018-01-01'
maxCountnumber100
noMergesbooleantrue

Examples of Result

Example result of each methods.

getByPerDayOfMonth

[ { day: 1, count: 809 },
  { day: 2, count: 733 },
...
  { day: 30, count: 642 },
  { day: 31, count: 340 } ]

getByPerMonth

[ { id: 1, month: 'Jan', count: 2124 },
  { id: 2, month: 'Feb', count: 2147 },
...
  { id: 11, month: 'Nov', count: 1631 },
  { id: 12, month: 'Dec', count: 2110 } ]

getByPerWeekDay

[ { id: 0, dayOfWeek: 'Sun', count: 1891 },
  { id: 1, dayOfWeek: 'Mon', count: 3899 },
...
  { id: 5, dayOfWeek: 'Fri', count: 3765 },
  { id: 6, dayOfWeek: 'Sat', count: 1950 } ]

getByPerYear

[ { year: 2009, count: 915 },
  { year: 2010, count: 1945 },
...
  { year: 2017, count: 4610 },
  { year: 2018, count: 3429 } ]

getByDayHour

[ { hour: 0, count: 744 },
  { hour: 1, count: 671 },
...
  { hour: 22, count: 987 },
  { hour: 23, count: 938 } ]

License

MIT

Keywords

FAQs

Last updated on 13 Oct 2018

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc