Socket
Book a DemoInstallSign in
Socket

giterator

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

giterator

git log as a JavaScript generator

latest
Source
npmnpm
Version
0.6.0
Version published
Maintainers
1
Created
Source

giterator

git log as a JavaScript generator

Installation

npm install --save giterator

Usage

import { giterator } from 'giterator';

for await (const commit of giterator('/Users/foldleft/Dev/syncpack', {
  pageSize: 20,
  skipMerges: true,
  tokenNames: ['authorEmail', 'subject', 'refNames'],
})) {
  console.log(commit);
}

Our example would produce;

{
  authorName: 'Jamie Mason',
  subject: 'chore(license): update year',
  refNames: 'HEAD -> master, origin/master, origin/HEAD'
}
{
  authorName: 'Jamie Mason',
  subject: 'chore(release): 9.8.4',
  refNames: 'tag: 9.8.4'
}
{
  authorName: 'Jamie Mason',
  subject: 'docs(site): mark up required/optional config',
  refNames: 'origin/dev, dev'
}
{
  authorName: 'Jamie Mason',
  subject: 'feat(semver): support resolving with lowest version',
  refNames: ''
}
// ...etc

Options

directory string

Absolute path to your locally cloned git repository.

options.tokenNames string[]

Optional array of strings representing the data required from each git commit (defaults to all).

  • authorDate
  • authorDateRelative
  • authorEmail
  • authorName
  • body
  • commitHash
  • commitNotes
  • committerDate
  • committerDateRelative
  • committerEmail
  • committerName
  • parentHashes
  • reflogIdentityEmail
  • reflogIdentityName
  • reflogSelector
  • reflogSubject
  • refNames
  • sanitizedSubjectLine
  • subject
  • treeHash

For more information see the Git Pretty Formats Documentation.

options.skipMerges boolean

Whether to exclude merge commits from being returned (defaults to true).

Badges

Keywords

git

FAQs

Package last updated on 21 Feb 2023

Did you know?

Socket

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