git-raw-commits
Advanced tools
Comparing version 0.0.0 to 0.0.1
12
index.js
@@ -36,4 +36,5 @@ 'use strict'; | ||
var throughStream = es.through(); | ||
getLatestTag(function(err, latestTag) { | ||
if (err || latestTag === undefined) { | ||
@@ -70,9 +71,12 @@ if (done === true) { | ||
if (done === true) { | ||
return stream.pipe(process.stdout); | ||
stream.pipe(process.stdout); | ||
} | ||
return stream | ||
.pipe(es.writeArray(done)); | ||
else { | ||
stream.pipe(throughStream).pipe(es.writeArray(done)); | ||
} | ||
}); | ||
return throughStream; | ||
} | ||
module.exports = gitRawCommits; |
{ | ||
"name": "git-raw-commits", | ||
"version": "0.0.0", | ||
"version": "0.0.1", | ||
"description": "Get raw git commits out of your repository using git-log(1)", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/stevemao/git-latest-tag", |
@@ -18,13 +18,28 @@ # [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-url]][daviddm-image] | ||
### Use a callback | ||
```js | ||
var gitRawCommits = require('git-raw-commits'); | ||
gitRawCommits([options], callback); | ||
gitRawCommits(options, callback); | ||
``` | ||
### Use as a through stream | ||
```js | ||
var gitRawCommits = require('git-raw-commits'); | ||
gitRawCommits(options) | ||
.pipe(...); | ||
``` | ||
## API | ||
### options | ||
### gitRawCommits([options], [callback]) | ||
Returns a through stream. | ||
#### options | ||
Type: `object` | ||
@@ -34,17 +49,25 @@ | ||
*NOTE*: for <revision range> we use also use <from>..<to> pattern, where: | ||
*NOTE*: for `<revision range>` we can also use `<from>..<to>` pattern, where: | ||
#### from | ||
Type: `string` defaults to your latest tag | ||
Type: `string` Default: your latest tag | ||
If you have no tag it will ignore `to` and get the whole commits | ||
If you have no tag it will ignore `to` and get the whole commits. | ||
#### to | ||
Type: `string` defaults to 'HEAD' | ||
Type: `string` Default: `'HEAD'` | ||
Only used if `from` is truthy | ||
Only used if `from` is truthy. | ||
#### callback(err, commits) | ||
##### commits | ||
Type: `array` | ||
An array of raw commits. | ||
## CLI | ||
@@ -56,3 +79,3 @@ | ||
``` | ||
```sh | ||
$ git-raw-commits --help | ||
@@ -59,0 +82,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4758
83
99