git-count-files

0.1.0 • Public • Published

git-count-files

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

Usage

gitCountFiles(repoPath, revision, callback);

Example

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

Tests

npm test

License

MIT

Package Sidebar

Install

npm i git-count-files

Weekly Downloads

0

Version

0.1.0

License

MIT

Last publish

Collaborators

  • alessioalex