file-util-git-history
TypeScript icon, indicating that this package has built-in type declarations

3.1.0 • Public • Published

file-util-git-history

NPM Version CI

Installation

# npm installation
npm install file-util-git-history

# yarn installation
yarn add file-util-git-history

Usage

const { gitHistory } = require("file-util-git-history");

// get history for current file
gitHistory(__filename)
  // get the SHA hash for each commit
  .then((history) => history.map(({ commit }) => commit.sha()))
  // print out the SHAs
  .then(console.log);

git history can accept two parameters:

  • {string} filePath path to file
  • {Object} [options] optional configuration
    • {string} [gitPath] - optional predetermined git folder to get history from

will return a promise that resolves to a list of {status, commit}. Where status is a git status code, and commit is a nodegit Commit class.

Package Sidebar

Install

npm i file-util-git-history

Weekly Downloads

79

Version

3.1.0

License

MIT

Unpacked Size

8.09 kB

Total Files

5

Last publish

Collaborators

  • christianmurphy