git-rev-promises

1.1.0 • Public • Published

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"
  //]]
 

Readme

Keywords

Package Sidebar

Install

npm i git-rev-promises

Weekly Downloads

202

Version

1.1.0

License

MIT

Unpacked Size

9.31 kB

Total Files

5

Last publish

Collaborators

  • codemeasandwich