Socket
Socket
Sign inDemoInstall

git-rev-promises

Package Overview
Dependencies
0
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    git-rev-promises

get the current git commit hash, tag or branch in node


Version published
Maintainers
1
Install size
9.89 kB
Created

Readme

Source

git-rev + promises

npm version Buy me a coffee

access git revision state in node with promises

If this was helpful, ★ it on github

Install

npm install git-rev-promises

Example

run sample

node example/simple.js

Methods

var git = require('git-rev-promises')

.short()

return the short commit hash

.long()

return the long commit hash

.tag()

return the current tag

.tags()

return all the tags sorted

.branch()

return the current branch

.origin()

return the url for origin

.repo()

return the name of the repository as defined on the origin.

.message()

return the last commit message on this branch

.date()

return the date of the last commit

.isUpdateToDate()

return where or not you are on the SAME commit as origin

.count()

return the commit count

.log()

return the git log of process.cwd() as an array

git.log().then(console.log).catch(console.error)
  //[[
  //  "83d9628821fb3fa83a0540d329051a862d0b7e01",
  //  "Remove code dump from readme + added missing function call info",
  //  "7 hours ago",
  //  "brian"
  //],[
  //  "9309bff7ad5f8fc8e1a9dcdac84d43d0cdff426b",
  //  "Add commit-message command + you can now pass in a string parsing function",
  //  "7 hours ago",
  //  "brian"
  //],[
  //  "1b69da352c8dc3efec347d8be0e80cc849302fd7",
  //  "Adds `date` promise to return date of commit",
  //  "7 hours ago",
  //  "brian"
  //]]

Keywords

FAQs

Last updated on 26 Jun 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc