git-commit-id

2.0.1 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i git-commit-id

Weekly Downloads

2,550

Version

2.0.1

License

MIT

Unpacked Size

3.41 kB

Total Files

6

Last publish

Collaborators

  • sheerun