Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

git-log-parser

Package Overview
Dependencies
Maintainers
0
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

git-log-parser

git-log-parser

  • 1.2.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.1M
decreased by-28.48%
Maintainers
0
Weekly downloads
 
Created

What is git-log-parser?

The git-log-parser npm package is a tool for parsing git logs in a structured way. It allows users to extract and manipulate information from git logs programmatically, making it easier to analyze commit history, authorship, and other repository metadata.

What are git-log-parser's main functionalities?

Parse Commit Logs

This feature allows you to parse the commit logs of a git repository. The code sample demonstrates how to use the git-log-parser to extract commit information and store it in an array.

const gitLogParser = require('git-log-parser');
const { exec } = require('child_process');

const commits = [];

exec('git log', { maxBuffer: Infinity }, (err, stdout) => {
  if (err) throw err;
  gitLogParser.parse({ _: ['log'] }, stdout).on('data', commit => {
    commits.push(commit);
  }).on('end', () => {
    console.log(commits);
  });
});

Filter Commits by Author

This feature allows you to filter commits by a specific author. The code sample shows how to use the git-log-parser to extract commits made by a particular author.

const gitLogParser = require('git-log-parser');
const { exec } = require('child_process');

const commits = [];

exec('git log --author="Author Name"', { maxBuffer: Infinity }, (err, stdout) => {
  if (err) throw err;
  gitLogParser.parse({ _: ['log'] }, stdout).on('data', commit => {
    commits.push(commit);
  }).on('end', () => {
    console.log(commits);
  });
});

Extract Commit Messages

This feature allows you to extract commit messages from the git log. The code sample demonstrates how to use the git-log-parser to get the commit messages and store them in an array.

const gitLogParser = require('git-log-parser');
const { exec } = require('child_process');

const commitMessages = [];

exec('git log --pretty=format:"%s"', { maxBuffer: Infinity }, (err, stdout) => {
  if (err) throw err;
  gitLogParser.parse({ _: ['log'] }, stdout).on('data', commit => {
    commitMessages.push(commit.subject);
  }).on('end', () => {
    console.log(commitMessages);
  });
});

Other packages similar to git-log-parser

FAQs

Package last updated on 01 Jul 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc