Go to file
KaKi87 0520b8d6d3 🎉 Initial commit 2022-12-23 17:14:11 +01:00
.gitignore 🎉 Initial commit 2022-12-23 17:14:11 +01:00
README.md 🎉 Initial commit 2022-12-23 17:14:11 +01:00
mod.js 🎉 Initial commit 2022-12-23 17:14:11 +01:00
package.json 🎉 Initial commit 2022-12-23 17:14:11 +01:00

README.md

last-git-commit-id

Asynchronously or synchronously get the last Git commit ID.

Usage

Asynchronous

import {
    getLastGitCommitId
} from 'last-git-commit-id';
(async () => {
    console.log(await getLastGitCommitId());
})();

Synchronous

import {
    getLastGitCommitIdSync
} from 'last-git-commit-id';
console.log(getLastGitCommitIdSync());

Inspired by answers to the Get hash of most recent git commit in Node question on StackOverflow, but using the newer & simpler syntax.