Skip to content

Commit 3cfdbcb

Browse files
committed
clarify docs
1 parent 66e96a9 commit 3cfdbcb

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,28 @@
99

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

12-
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.
12+
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.`
1313

1414
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`.
1515

16+
Typical usage:
17+
18+
```js
19+
var spawn = require('child_process').spawn
20+
, split2 = require('split2')
21+
, listStream = require('list-stream')
22+
23+
spawn('bash', [ '-c', 'git log' ])
24+
.stdout.pipe(split2()) // break up by newline characters
25+
.pipe(commitStream('rvagg', 'commit-stream'))
26+
.pipe(listStream.obj(onCommitList))
27+
28+
29+
function onCommitList (err, list) {
30+
// list is an array of objects
31+
}
32+
```
33+
1634
Commit object properties:
1735

1836
* `sha`: the full commit sha

0 commit comments

Comments
 (0)