sheerun / git-commit-id

Returns commit id (commit sha) of git repository. Useful for Next.js or Sentry.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

git-commit-id Build Status Modern Node

Returns commit id (commit sha) of git repository

This package is fast, has no dependencies, has synchronous API, doesn't require git binary.

Useful e.g. for CI, release for Sentry or build id for Next.js

Installation

yarn add --dev git-commit-id

If you're using npm you can use: npm install --save-dev git-commit-id.

Usage

const gitCommitId = require('git-commit-id')

const commitId = gitCommitId()

Custom directory

You can pass cwd option to specify custom git directory:

const commitId = gitCommitId({ cwd: __dirname })

License

MIT

About

Returns commit id (commit sha) of git repository. Useful for Next.js or Sentry.

License:MIT License


Languages

Language:JavaScript 100.0%