git-data-extractor
A node module to extract information from git repositories.
Installation
Using NPM
npm install git-data-extractor --save-dev
Clone git repository
git clone https://github.com/suhdev/git-data-extractor.git
Usage
var Git = Git; var defaults = { var m = tag2 version; if m && mlength > 0 try version = semver; catche finally if !version version = {}; versionshortSha = tag0; versionlongSha = tag1; return version; else null; } { return version; } { return linelineline; } tagComparator:semvercompare lineRegex:/[a-f0-9]{40}[ \t]+.*v[0-9][^ \/]*[0-9]$/gm versionRegex:/v[0-9][^ \/]+[0-9]$/gm gitUrl:null gitRepositoryPath:null packageSrc:path; var git = defaults; //gets the details for the repository set in the configuration git; //to get the tags for a given repositorygit; //to get the tags and versions for a remote repository git; //to get commits summary for the current repository (set in the configuration)git //to get commits summary for a given repository git; //to get repository info from URL git;
Notes
- The module uses semantic versionsing to extract the versions from git. This can be overriden through the configuration settings.
Suhail Abood © 2015