# commits-between

> Get commit messages bewteen git tags.

Latest version **0.2.0** (published 2016-05-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install commits-between
pnpm add commits-between
yarn add commits-between
bun add commits-between
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2016-05-20 |
| First published | 2016-03-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4 |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | EGOIST |
| Maintainers | kchan |

## Links

- npm: https://www.npmjs.com/package/commits-between
- Repository: https://github.com/egoist/commits-between
- Homepage: https://github.com/egoist/commits-between#readme
- Issues: https://github.com/egoist/commits-between/issues
- npm.io page: https://npm.io/package/commits-between

## Dependencies (2)

- [git-log-parser](https://npm.io/package/git-log-parser.md) ^1.2.0
- [stream-to-array](https://npm.io/package/stream-to-array.md) ^2.3.0

## Recent versions

- 0.2.0 (latest) — 2016-05-20
- 0.1.0 — 2016-03-17

## README

# commits-between [![NPM version](https://img.shields.io/npm/v/commits-between.svg)](https://npmjs.com/package/commits-between) [![NPM downloads](https://img.shields.io/npm/dm/commits-between.svg)](https://npmjs.com/package/commits-between) [![Build Status](https://img.shields.io/circleci/project/egoist/commits-between/master.svg)](https://circleci.com/gh/egoist/commits-between)

> Get commit messages between git tags or commit hashes.

## Install

```bash
$ npm install --save commits-between
```

## Usage

```js
const commitsBetween = require('commits-between')

commitsBetween({from: 'v0.0.1'})
// commits from tag v0.0.1 to HEAD

commitsBetween({from: 'v0.0.1', to: 'v0.0.2'})
// commits from tag v0.0.1 to v0.0.2

//=> return a Promise which resolves:
[ { commit:
     { long: 'd3c1d4277bea361e2aec19068f909262cf51f678',
       short: 'd3c1d42' },
    tree:
     { long: 'd95361141f51314048917373cc34de25cefd8789',
       short: 'd953611' },
    author:
     { name: 'Your Name',
       email: 'you@example.com',
       date: Fri May 20 2016 16:14:49 GMT+0800 (CST) },
    committer:
     { name: 'Your Name',
       email: 'you@example.com',
       date: Fri May 20 2016 16:14:49 GMT+0800 (CST) },
    subject: 'yeah',
    body: 'hello world\n' } ]

// since we use `git log --pretty=format:%s%b to get commits`
// so commit hash works too
commitsBetween({from: '73e7dab2b07e68b3', to: 'ee36f4bcc7bcaf'})

// or all commits
commitsBetween()
```

## API

### commitsBetween(options)

#### options

Type: `object`

##### from

Type: `string`  
Required: `true`

From this tag or commit hash.

##### to

Type: `string`  
Default: `''`

Before this tag or commit hash, default is `HEAD`.

##### cwd

Type: `string`  
Default: `process.cwd()`

Choose a working directory to resolve commits

## License

MIT © [EGOIST](https://github.com/egoist)

---
_Source: https://npm.io/package/commits-between · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
