Socket
Socket
Sign inDemoInstall

async-git

Package Overview
Dependencies
2
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    async-git

👾 Retrieve data from current git repository


Version published
Maintainers
1
Created

Readme

Source

async-git

👾 Retrieve data from current git repository

* Getter properties are async (getters) more on async properties

const git = require('async-git');

`${await git.author} committed ${await git.message}` // Omri committed Some changes

Getters

PropertyTypeDescriptionExample
authorstringAuthor name of the last commitawait git.author
bodystringMost recent commit message bodyawait git.body
branchstringCurrent branch nameawait git.branch
changedstring[]List of files changed in last commitawait git.changed
comitterstringComitter name of the last commitawait git.comitter
dateDateDate of the last changeawait git.date
emailstringAuthor email of the last commitawait git.email
messagestringMost recent commit full message (subject and body)await git.message
namestringProject nameawait git.name
originstringRemote origin URLawait git.origin
shastringUnique identifier of the last commitawait git.sha
shortstring7 Character Unique identifier of the last commitawait git.short
stagedstring[]List of staged filesawait git.staged
subjectstringMost recent commit subjectawait git.subject
unstagedstring[]List of unstaged filesawait git.unstaged
untrackedstring[]List of untracked filesawait git.untracked
versionstringGet git version (semver)await git.version

Functions

modified

Get the last modified date of a file

await modified('./index.js')
ArgumentReturn value
{string} Path to file{Date} Last modified date

reset

Reset current HEAD to the specified destination

await git.reset(1) // reset number of commit back
await git.reset('f5db755') // reset to specific SHA ID
ArgumentReturn value
{string|number} State ID{void} nothing

tag

Create a tag using the last commit message

await git.tag('1.2.3')
ArgumentReturn value
{string} Version{void} nothing

Keywords

FAQs

Last updated on 06 Nov 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