Socket
Socket
Sign inDemoInstall

git-last-commit

Package Overview
Dependencies
0
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    git-last-commit

Read details of the last commit including tags


Version published
Weekly downloads
138K
increased by20.88%
Maintainers
1
Install size
19.7 kB
Created
Weekly downloads
 

Readme

Source

git-last-commit

Node.js module to read last git commit information including tags and branch - mostly to be used by continuous integration and build systems for build tagging purposes.

Usage

var git = require('git-last-commit');

git.getLastCommit(function(err, commit) {
  // read commit object properties
  console.log(commit);
});

Function returns an object like this:

{
  "shortHash": "d2346fa",
  "hash": "d2346faac31de5e954ef5f6baf31babcd3e899f2",
  "subject": "initial commit",
  "sanitizedSubject": "initial-commit",
  "body": "this is the body of the commit message",
  "authoredOn": "1437988060",
  "committedOn": "1437988060",
  "author": {
    "name": "Ozan Seymen",
    "email": "oseymen@gmail.com"
  },
  "committer": {
    "name": "Ozan Seymen",
    "email": "oseymen@gmail.com"
  },
  "notes": "commit notes",
  "branch": "master",
  "tags": ['R1', 'R2']
}

You can add path destination if you want to get git last commit information on another repository:

var git = require('git-last-commit');

git.getLastCommit(function(err, commit) {
  // read commit object properties
  console.log(commit);
}, {dst: 'some/other/path'});

Keywords

FAQs

Last updated on 21 Aug 2021

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