Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gitlog

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gitlog - npm Package Compare versions

Comparing version 3.2.0 to 3.2.1-canary.4ad2eb5.0

.all-contributorsrc

26

example/example.js

@@ -1,18 +0,12 @@

var gitlog = require('../')
, options =
{ repo: __dirname + '/test-repo-folder'
, number: 20
, author: 'Dom Harrington'
, fields:
[ 'hash'
, 'abbrevHash'
, 'subject'
, 'authorName'
, 'authorDateRel'
]
}
var gitlog = require("../"),
options = {
repo: __dirname + "/test-repo-folder",
number: 20,
author: "Dom Harrington",
fields: ["hash", "abbrevHash", "subject", "authorName", "authorDateRel"],
};
gitlog(options, function(error, commits) {
gitlog(options, function (error, commits) {
// Commits is an array of commits in the repo
console.log(commits)
})
console.log(commits);
});
{
"name": "gitlog",
"version": "3.2.0",
"version": "3.2.1-canary.4ad2eb5.0",
"description": "Git log parser for Node.JS",
"main": "index.js",
"module": "dist/gitlog.esm.js",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"scripts": {
"lint": "jshint .",
"checkStyle": "jscs .",
"test": "istanbul cover ./node_modules/.bin/_mocha -- -r should",
"posttest": "istanbul check-coverage --statements 95 --branches 85 --functions 100 --lines 95 && rm -rf coverage"
"start": "tsdx watch",
"build": "tsdx build",
"test": "tsdx test",
"lint": "tsdx lint src test"
},

@@ -24,18 +26,40 @@ "publishConfig": {

],
"author": "Dom Harrington",
"license": "BSD",
"author": "Dom Harrington <domharrington@protonmail.com>",
"license": "BSD-3-Clause",
"engines": {
"node": ">=0.11.12"
"node": ">= 10.x"
},
"devDependencies": {
"istanbul": "^0.4.5",
"jscs": "^3.0.7",
"jshint": "^2.5.6",
"mocha": "^3.0.2",
"should": "~11.1.0"
"@auto-it/all-contributors": "^9.26.5",
"@auto-it/first-time-contributor": "^9.26.5",
"@types/debug": "^4.1.5",
"@types/jest": "^25.2.1",
"all-contributors-cli": "^6.14.1",
"auto": "^9.26.5",
"husky": "^4.2.3",
"lint-staged": "^10.1.2",
"prettier": "^2.0.4",
"tsdx": "^0.13.1",
"typescript": "^3.8.3"
},
"dependencies": {
"debug": "^3.1.0",
"lodash.assign": "^4.2.0"
"debug": "^4.1.1",
"tslib": "^1.11.1"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.{js,css,md,ts,json}": "prettier --write"
},
"auto": {
"plugins": [
"npm",
"released",
"first-time-contributor",
"all-contributors"
]
}
}

@@ -10,3 +10,5 @@ # node-gitlog

npm install gitlog --save
```sh
npm install gitlog --save
```

@@ -16,29 +18,26 @@ ## Usage

```js
const gitlog = require('gitlog');
const gitlog = require("gitlog");
const options =
{ repo: __dirname + '/test-repo-folder'
, number: 20
, author: 'Dom Harrington'
, fields:
[ 'hash'
, 'abbrevHash'
, 'subject'
, 'authorName'
, 'authorDateRel'
]
, execOptions:
{ maxBuffer: 1000 * 1024
}
};
const options = {
repo: __dirname + "/test-repo-folder",
number: 20,
author: "Dom Harrington",
fields: ["hash", "abbrevHash", "subject", "authorName", "authorDateRel"],
execOptions: { maxBuffer: 1000 * 1024 },
};
// Synchronous
const commits = gitlog(options);
console.log(commits);
// Asynchronous (with Callback)
gitlog(options, function(error, commits) {
gitlog(options, function (error, commits) {
// Commits is an array of commits in the repo
console.log(commits)
console.log(commits);
});
// Synchronous
let commits = gitlog(options);
console.log(commits);
// Asynchronous (with Promise)
gitlog(options)
.then((commits) => console.log(commits))
.catch((err) => console.log(err));
```

@@ -51,17 +50,23 @@

### repo
The location of the repo, required field.
### number
The number of commits to return, defaults to 10.
### since/after
Show commits more recent than a specific date.
### until/before
Show commits older than a specific date.
### author/committer
Limit the commits output to ones with author/committer header lines that match the specified pattern.
### nameStatus
Below fields was returned from the log:

@@ -75,2 +80,3 @@

### findCopiesHarder
Much more likely to set status codes to 'C' if files are exact copies of each other.

@@ -81,2 +87,3 @@

### includeMergeCommitFiles
Pass the `-m` option to includes files in a merge commit.

@@ -87,2 +94,3 @@

### all
Find commits on all branches instead of just on the current one.

@@ -93,6 +101,11 @@

### branch ([revision range](https://git-scm.com/docs/git-log#git-log-ltrevisionrangegt))
Show only commits in the specified branch or revision range.
Show only commits in the specified branch or revision range.
By default uses the current branch and defaults to `HEAD` (i.e. the whole history leading to the current commit).
### file
Optional file filter for the `git log` command
### execOptions

@@ -104,30 +117,31 @@

- `cwd` String *Current working directory of the child process*
- `env` Object *Environment key-value pairs*
- `cwd` String _Current working directory of the child process_
- `env` Object _Environment key-value pairs_
- `setsid` Boolean
- `encoding` String *(Default: 'utf8')*
- `timeout` Number *(Default: 0)*
- `maxBuffer` Number *(Default: 200\*1024)*
- `killSignal` String *(Default: 'SIGTERM')*
- `encoding` String _(Default: 'utf8')_
- `timeout` Number _(Default: 0)_
- `maxBuffer` Number _(Default: 200\*1024)_
- `killSignal` String _(Default: 'SIGTERM')_
### optional fields
An array of fields to return from the log, here are the possible options:
- hash - the long hash of the commit e.g. 7dd0b07625203f69cd55d779d873f1adcffaa84a
- abbrevHash - the abbreviated commit hash e.g. 7dd0b07
- treeHash - the tree hash of the commit
- abbrevTreeHash - the abbreviated commit hash
- parentHashes - the parent hashes
- abbrevParentHashes - the abbreviated parent hashes
- authorName - author name of the commit
- authorEmail - author email of the commit
- authorDate - author date of the commit
- authorDateRel - relative author date of the commit
- committerName - committer name
- committerEmail - committer email
- committerDate - committer date
- committerDateRel - relative committer date
- subject - commit message (first line)
- body - commit body
- rawBody - raw body (subject + body)
- `hash` - the long hash of the commit e.g. 7dd0b07625203f69cd55d779d873f1adcffaa84a
- `abbrevHash` - the abbreviated commit hash e.g. 7dd0b07
- `treeHash` - the tree hash of the commit
- `abbrevTreeHash` - the abbreviated commit hash
- `parentHashes` - the parent hashes
- `abbrevParentHashes` - the abbreviated parent hashes
- `authorName` - author name of the commit
- `authorEmail` - author email of the commit
- `authorDate` - author date of the commit
- `authorDateRel` - relative author date of the commit
- `committerName` - committer name
- `committerEmail` - committer email
- `committerDate` - committer date
- `committerDateRel` - relative committer date
- `subject` - commit message (first line)
- `body` - commit body
- `rawBody` - raw body (subject + body)

@@ -141,20 +155,63 @@ Defaults to 'abbrevHash', 'hash', 'subject' and 'authorName'.

## Example
```javascript
{ hash: '6a7ef5e3b3d9c77743140443c8f9e792b0715721',
abbrevHash: '6a7ef5e',
treeHash: 'f1bf51b15b48a00c33727f364afef695029864c0',
abbrevTreeHash: 'f1bf51b',
parentHashes: 'cfe06dbdb8d0a193640977e016a04678f8f3b04f',
abbrevParentHashes: 'cfe06dbdb8d0a193640977e016a04678f8f3b04f',
authorName: 'Dom Harrington',
authorEmail: 'dom@harringtonxxxxx',
authorDate: '2015-04-09 09:39:23 +0100',
authorDateRel: '6 days ago',
committerName: 'Dom Harrington',
committerEmail: 'dom@harringtonxxxxx',
committerDate: 'Thu Apr 9 09:39:23 2015 +0100',
committerDateRel: '6 days ago',
subject: '1.0.0',
status: [ 'M' ],
files: [ 'package.json' ] }
The following is an example of what a parsed commit might look like.
```json
{
"hash": "6a7ef5e3b3d9c77743140443c8f9e792b0715721",
"abbrevHash": "6a7ef5e",
"treeHash": "f1bf51b15b48a00c33727f364afef695029864c0",
"abbrevTreeHash": "f1bf51b",
"parentHashes": "cfe06dbdb8d0a193640977e016a04678f8f3b04f",
"abbrevParentHashes": "cfe06dbdb8d0a193640977e016a04678f8f3b04f",
"authorName": "Dom Harrington",
"authorEmail": "dom@harringtonxxxxx",
"authorDate": "2015-04-09 09:39:23 +0100",
"authorDateRel": "6 days ago",
"committerName": "Dom Harrington",
"committerEmail": "dom@harringtonxxxxx",
"committerDate": "Thu Apr 9 09:39:23 2015 +0100",
"committerDateRel": "6 days ago",
"subject": "1.0.0",
"status": ["M"],
"files": ["package.json"]
}
```
## Contributors ✨
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
<tr>
<td align="center"><a href="https://github.com/domharrington"><img src="https://avatars0.githubusercontent.com/u/848223?v=4" width="100px;" alt=""/><br /><sub><b>domharrington</b></sub></a><br /><a href="https://github.com/domharrington/node-gitlog/commits?author=domharrington" title="Code">💻</a> <a href="https://github.com/domharrington/node-gitlog/commits?author=domharrington" title="Documentation">📖</a> <a href="#example-domharrington" title="Examples">💡</a> <a href="#ideas-domharrington" title="Ideas, Planning, & Feedback">🤔</a></td>
<td align="center"><a href="http://hipstersmoothie.com"><img src="https://avatars3.githubusercontent.com/u/1192452?v=4" width="100px;" alt=""/><br /><sub><b>Andrew Lisowski</b></sub></a><br /><a href="https://github.com/domharrington/node-gitlog/commits?author=hipstersmoothie" title="Code">💻</a> <a href="https://github.com/domharrington/node-gitlog/commits?author=hipstersmoothie" title="Documentation">📖</a> <a href="#infra-hipstersmoothie" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="#maintenance-hipstersmoothie" title="Maintenance">🚧</a></td>
<td align="center"><a href="http://metaodi.ch"><img src="https://avatars1.githubusercontent.com/u/538415?v=4" width="100px;" alt=""/><br /><sub><b>Stefan Oderbolz</b></sub></a><br /><a href="https://github.com/domharrington/node-gitlog/issues?q=author%3Ametaodi" title="Bug reports">🐛</a> <a href="https://github.com/domharrington/node-gitlog/commits?author=metaodi" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/palortoff"><img src="https://avatars1.githubusercontent.com/u/10258543?v=4" width="100px;" alt=""/><br /><sub><b>palortoff</b></sub></a><br /><a href="https://github.com/domharrington/node-gitlog/issues?q=author%3Apalortoff" title="Bug reports">🐛</a> <a href="https://github.com/domharrington/node-gitlog/commits?author=palortoff" title="Code">💻</a></td>
<td align="center"><a href="https://malys.github.io/"><img src="https://avatars1.githubusercontent.com/u/463016?v=4" width="100px;" alt=""/><br /><sub><b>Malys</b></sub></a><br /><a href="https://github.com/domharrington/node-gitlog/issues?q=author%3Amalys" title="Bug reports">🐛</a> <a href="https://github.com/domharrington/node-gitlog/commits?author=malys" title="Code">💻</a> <a href="https://github.com/domharrington/node-gitlog/commits?author=malys" title="Documentation">📖</a></td>
<td align="center"><a href="http://CodeGymSleep.com/"><img src="https://avatars3.githubusercontent.com/u/6986032?v=4" width="100px;" alt=""/><br /><sub><b>Mike Mellor</b></sub></a><br /><a href="https://github.com/domharrington/node-gitlog/commits?author=mikemellor11" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/hmedney"><img src="https://avatars3.githubusercontent.com/u/1221751?v=4" width="100px;" alt=""/><br /><sub><b>Hunter Medney</b></sub></a><br /><a href="https://github.com/domharrington/node-gitlog/commits?author=hmedney" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/Gilwyad"><img src="https://avatars3.githubusercontent.com/u/1919041?v=4" width="100px;" alt=""/><br /><sub><b>Peter Baranyi</b></sub></a><br /><a href="https://github.com/domharrington/node-gitlog/commits?author=Gilwyad" title="Code">💻</a> <a href="https://github.com/domharrington/node-gitlog/issues?q=author%3AGilwyad" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://twitter.com/B_Blackwo"><img src="https://avatars0.githubusercontent.com/u/7598058?v=4" width="100px;" alt=""/><br /><sub><b>Benjamin Blackwood</b></sub></a><br /><a href="https://github.com/domharrington/node-gitlog/commits?author=BBlackwo" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/Asheboy"><img src="https://avatars1.githubusercontent.com/u/1822529?v=4" width="100px;" alt=""/><br /><sub><b>Ash Summers</b></sub></a><br /><a href="https://github.com/domharrington/node-gitlog/commits?author=Asheboy" title="Code">💻</a> <a href="https://github.com/domharrington/node-gitlog/commits?author=Asheboy" title="Tests">⚠️</a></td>
<td align="center"><a href="https://github.com/007design"><img src="https://avatars0.githubusercontent.com/u/1998403?v=4" width="100px;" alt=""/><br /><sub><b>007design</b></sub></a><br /><a href="https://github.com/domharrington/node-gitlog/commits?author=007design" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/tobaccoplaybook"><img src="https://avatars2.githubusercontent.com/u/21124900?v=4" width="100px;" alt=""/><br /><sub><b>tobaccoplaybook</b></sub></a><br /><a href="https://github.com/domharrington/node-gitlog/commits?author=tobaccoplaybook" title="Code">💻</a></td>
<td align="center"><a href="http://nicola.io"><img src="https://avatars1.githubusercontent.com/u/1424850?v=4" width="100px;" alt=""/><br /><sub><b>Nicola</b></sub></a><br /><a href="https://github.com/domharrington/node-gitlog/commits?author=nicola" title="Code">💻</a></td>
<td align="center"><a href="http://bluelovers.net"><img src="https://avatars0.githubusercontent.com/u/167966?v=4" width="100px;" alt=""/><br /><sub><b>bluelovers</b></sub></a><br /><a href="https://github.com/domharrington/node-gitlog/commits?author=bluelovers" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/afram"><img src="https://avatars0.githubusercontent.com/u/2238230?v=4" width="100px;" alt=""/><br /><sub><b>Marwan Butrous</b></sub></a><br /><a href="https://github.com/domharrington/node-gitlog/commits?author=afram" title="Code">💻</a></td>
</tr>
</table>
<!-- markdownlint-enable -->
<!-- prettier-ignore-end -->
<!-- ALL-CONTRIBUTORS-LIST:END -->
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc