git-info by @michalbe
Get detailed data about current git repo.
npm install git-info
then:
var gi = require('git-info');
// First argument of the function can be a String
gi('name', function(err, result) {
console.log(result); // { name: name-of-the-repo }
});
// Or Array of Strings
gi(['name', 'author'], function(err, result) {
console.log(result); // { name: name-of-the-repo,
// author: author of the repo }
});
// Sometimes the answer can be multiline
gi('authors', function(err, result) {
console.log(result); // { authors: [array of all the authors from the project] }
});Supported commands:
author- top author of the repoauthors- list of all the authorsauthorDate- date of last commitauthorDateRelative- relative date of last commitname- name of the repositoryrepository- address of the repobranch- current branchbranches- all the branches in the reposha- sha of the last commitshaShort- short form of the sha of the last commitsubject- message of the last commit