JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 261195
  • Score
    100M100P100Q175697F

Synchronously get the current git commit hash, tag, or branch

Package Exports

  • git-rev-sync

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (git-rev-sync) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

git-rev-sync

Synchronously get the current git commit hash, tag, or branch. Forked from git-rev.

Example

var git = require('git-rev-sync');

console.log(git.short());
// 75bf4ee

console.log(git.long());
// 75bf4eea9aa1a7fd6505d0d0aa43105feafa92ef

console.log(git.branch());
// master

console.log(git.tag());
// not implemented

console.log(git.log());
// not implemented

You can also run these examples via: npm run examples

Install

npm install git-rev-sync --save

Methods

var git = require('git-rev-sync');

git.short() → <String>

return the result of git rev-parse --short HEAD

git.long() → <String>

return the result of git rev-parse HEAD

git.branch() → <String>

return the current branch

License

MIT