GithubHelp home page GithubHelp logo

node-git-log's Introduction

Node.js Git Log

Read Git commit history from Node.js.

Installation

npm install --save git-log

Usage

import gitLog from 'git-log'

const commits = await gitLog()

console.log(commits[0].title)
//=> Upgrade to Node.js 10.x

console.log(commits[0].date)
//=> 2019-10-07T20:47:10.000Z

console.log(commits[0].body)
//=> This patch change the Node.js verison to...

console.log(commits[0].hash)
//=> e79b76217e03ba5b4e87182d07f855d9ff3e6d95

API

gitLog([options])

  • options (object, optional)
    • merges (boolean, optional) - Wether or not to include commits with more than one parent.
    • range (string, optional) - Include only commits in the specified revision range. When no range is specified, it defaults to 'HEAD' (i.e. the whole history leading to the current commit).
    • repo (string, optional) - Path to the repository to read the log from. When no repo is specified, the current working dirtectory will be used.
    • path (string | string[], optional) - Path to a file or directory to limit results to specific changes. When no path is specified, the entire history of the project is returned.
  • returns Promise<object[]> - List of commits
    • subject (string) - Subject of the commit
    • body (string) - Body of the commit
    • hash (string) - Hash of the commit
    • date (Date) - Committer date of the commit

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.