$ npm install git-current-commitGet the current local git commit.
const getCommit = require('git-current-commit')
getCommit(function (err, commit) {
if (err) throw err
console.log(commit) // => '21ed11701a068b88b3890578a1c8a420972927a4'
})
getCommit.sync() // => '21ed11701a068b88b3890578a1c8a420972927a4'
getCommit.promise() // => '21ed11701a068b88b3890578a1c8a420972927a4'
$ npm install git-current-commit
MIT