<commit_before># commit-stream

**Turn a `git log` into a stream of commit objects**

[![npm](https://nodei.co/npm/commit-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/commit-stream/)
[![npm](https://nodei.co/npm-dl/commit-stream.png?months=6&height=3)](https://nodei.co/npm/commit-stream/)

## API

**`commitStream([defaultGithubUser, defaultGithubProject])`**

Returns an object stream that you can pipe the output of `git log` to. The output of the stream is a series of objects, each representing a commit from the log.

Intended to be used on a standard log format (not a simplified one using one of the simplifying `--format` options) but it will also process change stats if you `git log --stat`.

Commit object properties:

* `sha`: the full commit sha
* `author`: an object representing the author of the commit
  - `name`: the name of the committer
  - `email`: the email of the committer<commit_msg>clarify docs<commit_after># commit-stream

**Turn a `git log` into a stream of commit objects**

[![npm](https://nodei.co/npm/commit-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/commit-stream/)
[![npm](https://nodei.co/npm-dl/commit-stream.png?months=6&height=3)](https://nodei.co/npm/commit-stream/)

## API

**`commitStream([defaultGithubUser, defaultGithubProject])`**

Returns an object stream that you can pipe a stream of newlines from the output of `git log` to. The output of the stream is a series of objects, each representing a commit from the log.`

Intended to be used on a standard log format (not a simplified one using one of the simplifying `--format` options) but it will also process change stats if you `git log --stat`.

Typical usage:

```js
var spawn      = require('child_process').spawn
  , split2     = require('split2')
  , listStream = require('list-stream')

spawn('bash', [ '-c', 'git log' ])
  .stdout.pipe(split2()) // break up by newline characters
  .pipe(commitStream('rvagg', 'commit-stream'))
  .pipe(listStream.obj(onCommitList))


function onCommitList (err, list) {
  // list is an array of objects
}
```

Commit object properties:

* `sha`: the full commit sha
* `author`: an object representing the author of the commit
  - `name`: the name of the committer
  - `email`: the email of the committer
{'fraction_non_alphanumeric': 0.13263525305410123, 'fraction_numerical': 0.0030541012216404886, 'mean_word_length': 4.47255369928401, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6898692', 'n_tokens_mistral': 726, 'n_tokens_neox': 696, 'n_words': 256}