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

git-repo-info

Package Overview
Dependencies
Maintainers
2
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

git-repo-info

Retrieve current sha and branch name from a git repo.

  • 2.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
849K
increased by1.14%
Maintainers
2
Weekly downloads
 
Created

What is git-repo-info?

The git-repo-info npm package provides a simple way to gather information about a Git repository. It can be used to retrieve details such as the current branch, the latest commit hash, and other repository metadata.

What are git-repo-info's main functionalities?

Get Current Branch

This feature allows you to get the current branch name of the Git repository.

const gitRepoInfo = require('git-repo-info');
const info = gitRepoInfo();
console.log(info.branch);

Get Latest Commit Hash

This feature allows you to get the latest commit hash of the Git repository.

const gitRepoInfo = require('git-repo-info');
const info = gitRepoInfo();
console.log(info.sha);

Get Repository Root

This feature allows you to get the root directory of the Git repository.

const gitRepoInfo = require('git-repo-info');
const info = gitRepoInfo();
console.log(info.root);

Get Committer Date

This feature allows you to get the committer date of the latest commit in the Git repository.

const gitRepoInfo = require('git-repo-info');
const info = gitRepoInfo();
console.log(info.committerDate);

Other packages similar to git-repo-info

Keywords

FAQs

Package last updated on 18 Oct 2019

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