git-count-commits

0.1.0 • Public • Published

git-count-commits

Get the total number of commits for a repo and a specific revision by shelling out to git.

Usage

gitCountCommits(repoPath, revision, callback);

Example

var gitCountCommits = require('git-count-commits');
var path = require('path');
var repoPath = path.resolve(process.env.REPO || (__dirname + '/.git'));
var rev = process.env.REV || 'master';
 
gitCountCommits(repoPath, rev, function(err, commits) {
  if (err) { throw err; }
 
  console.log('Total commits for %s#%s: \n  = %s', repoPath, rev, commits);
});

Tests

npm test

License

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.0
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.0
    0

Package Sidebar

Install

npm i git-count-commits

Weekly Downloads

0

Version

0.1.0

License

MIT

Last publish

Collaborators

  • alessioalex