New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

git-head-info

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

git-head-info

Retrieve current sha and branch name from a git repo.

latest
Source
npmnpm
Version
0.1.2
Version published
Weekly downloads
1
-50%
Maintainers
1
Weekly downloads
 
Created
Source

git-head-info · GitHub npm CircleCI branch

Retrieve current sha and branch name from a git repo.

Install

npm i git-head-info

Usage

import gitHeadInfo from 'git-head-info' /* or */ const gitHeadInfo = require('git-head-info')

/**
 * @param {path | void} repo: the git repo to get HEAD info, default is current working dir
 * @returns ({
 *  repo: the repo used to get git info
 *  sha: HEAD sha
 *  branch: HEAD branch | undefined(if in `detached HEAD` state)
 * })
 */

// promise
gitHeadInfo(repo?).then(res => {
  ...
}).catch()

// async
async function foo() {
  try {
    const res = await gitHeadInfo(repo?)
    ...
  } catch() {}
}

Keywords

git

FAQs

Package last updated on 07 Sep 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