Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Tools for parsing data out of git repositories.
The goal of node-git-tools is to provide a set of tools that can be used to easily write custom git commands or other scripts that are tightly integrated with git.
I expect the API to grow over time and will happily entertain any feature requests. If there is anything you'd like added, just file an issue.
npm install git-tools
var Repo = require( "git-tools" );
var repo = new Repo( "path/to/repo" );
repo.authors(function( error, authors ) {
console.log( authors );
});
Gets the number of active days (unique days of authorship). Includes activity by day, month, year, and the entire history.
committish
(String; default: "master"
): Committish range to analyze.callback
(Function; function( error, activeDays )
): Function to invoke after getting active days.
activeDays
(Object): Summary of active days.The activeDays
object has the following form:
{
activeDays: Number,
commits: Number,
dates: {
"YYYY-MM-DD": Number( commits ),
...
},
years: {
"YYYY": {
activeDays: Number,
commits: Number,
months: {
"M": {
activeDays: Number,
commits: Number,
days: {
"D": {
commits: Number
},
...
}
},
...
}
},
...
}
}
Gets the age of the repository.
callback
(Function; function( error, age )
): Function to invoke after getting the age.
age
(String): The age of the repository.Gets all authors, sorted by number of commits.
committish
(String; default: "master"
): Committish range to analyze.callback
(Function; function( error, authors )
): Function to invoke after getting authors.
authors
(Array): All authors, sorted by number of commits.Each author object contains the following properties:
email
(String): Author's email address.name
(String): Author's name.commits
(Number): Number of commits.commitsPercent
(Number): Percentage of commits.Gets all branches in order of most recent commit.
callback
(Function; function( error, branches )
): Function to invoke after getting branches.
branches
(Array): All branches, sorted by most recent commit date.Each branch object contains the following properties:
name
(String): Branch name.sha
(String): SHA-1 of most recent commit.date
(Date): Author date of most recent commit.subject
(String): Subject (first line) of most recent commit.author
(Object): Author of most recent commit.
email
(String): Author's email address.name
(String): Author's name.Gets the name of the currently checked out branch, if any.
callback
(Function; function( error, branch )
): Function to invoke after getting the branch.
branch
(String|null): Branch name, or null
if in detached HEAD state.Gets all remote repositories.
callback
(Function; function( error, remotes )
): Function to invoke after getting the remotes.
remotes
(Array): All remote repositories.Each remote object contains the following properties:
name
(String): Remote name.url
(String): URL for the remote repository.Gets all tags in reverse chronological order.
Lightweight tags are sorted by author date and annotated tags are sorted by tagger date.
callback
(Function; function( error, tags )
): Function to invoke after getting tags.
tags
(Array): All tags, sorted by date.Each tag object contains the following properties:
name
(String): Tag name.sha
(String): SHA-1 for the tag. For lightweight tags, this is the SHA-1 of the commit.date
(Date): Author date for ligthweight tags, tagger date for annotated tags.Copyright 2013 Scott González. Released under the terms of the MIT license.
FAQs
Tools for parsing data out of git repositories.
The npm package git-tools receives a total of 12,823 weekly downloads. As such, git-tools popularity was classified as popular.
We found that git-tools demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.