git-current-commit
1.1.0
@juliangruber
Downloads:108
$ npm install git-current-commitgit-current-commit
Get the current local git commit.
Usage
const getCommit = require('git-current-commit')
getCommit(function (err, commit) {
if (err) throw err
console.log(commit) // => '21ed11701a068b88b3890578a1c8a420972927a4'
})
getCommit.sync() // => '21ed11701a068b88b3890578a1c8a420972927a4'
getCommit.promise() // => '21ed11701a068b88b3890578a1c8a420972927a4'
Installation
$ npm install git-current-commit
API
getCommit([dir], cb)
getCommit.sync([dir])
getCommit.promise([dir])
License
MIT