giti
v1.1.7
Published
Quick summary and informations about a git rep returning a js-json object.
Downloads
3,065
Readme
giti
Quick summary and informations about a git rep returning a js-json object.
originally based on git-info by @michalbe
How to use:
npm i giti -g
then either javascript:
var gi = require('giti');
// 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 }
});
// or nothing and we run all commands
gi(function(err, result) {
console.log(result);
});
or cli:
giti
{ sha: '962906a2ad46d6d40e40635baf0ec8f0a832e95b',
shaShort: '962906a',
branches: [ 'master', ' sha' ],
branch: 'master',
repository: '[email protected]:scherler/git-info.git',
authors:
[ 'Michal Budzynski <[email protected]>',
'Michał Budzyński <[email protected]>',
'Thorsten Scherler <[email protected]>' ],
author: 'Thorsten Scherler <[email protected]>',
authorDateRelative: '9 hours ago',
authorDate: 'Thu Apr 28 16:08:09 2016 +0200',
name: 'git-info',
subject: '[master] do not throw an error but call the callback with it as a normal person would do. Doh' }
giti name author branches
{ author: 'Thorsten Scherler <[email protected]>',
name: 'git-info',
branches: [ 'master', ' sha' ] }
API
Supported commands:
author
- last author of the repoauthors
- list of all the authorsauthorDate
- date of last commitauthorDateRelative
- date of last commitname
- name of the repositoryrepository
- address of the repobranch
- current branchbranches
- all the branches in the reposubject
- the message of the last commit