node-git-info-json

This module outputs a `git.properties.json` file with some [git commit information](#sample-output).

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
node-git-info-json
520.1.16 years ago6 years agoMinified + gzip package size for node-git-info-json in KB

Readme

Node Git Info JSON
This module outputs a git.properties.json file with some git commit information.
It was created because we created a Node Express app with a /info endpoint that serves some git information.

Usage

Globally

npm i -g node-git-info-json
node-git-info-json [options]

-d, --directory # Directory to save the file to, default is the cwd

Project Level

  1. Install as dev dependency

npm i -D node-git-info-json

  1. Add to package.json scripts, example below:

{
  "scripts": {
    "git-info": "node-git-info-json"
  }
}

  1. Run script as part of npm command

npm run git-info

Sample Output

git.properties.json
{
  "git": {
    "commit": {
      "message": {
        "full": "fake commit",
        "short": "fake commit"
      },
      "time": "Tue Jan 23 2018 15:46:45 GMT-0500 (EST)",
      "id": "af1fe75e2df23d1e93e884c6018d6f23dfee19c4",
      "abbrevId": "af1fe75",
      "user": {
        "email": "jimsmoody@gmail.com",
        "name": "JIM MOODY"
      }
    },
    "branch": "master"
  }
}

Acknowledgements

Basically a fork from the node-git-info project but the output is a .json file instead of a .properties file which is much easier to parse in a Node project.