# gulp-git-staged

> A plugin for Gulp

Latest version **0.0.1** (published 2015-05-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install gulp-git-staged
pnpm add gulp-git-staged
yarn add gulp-git-staged
bun add gulp-git-staged
```

## 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.0.1 |
| Published | 2015-05-26 |
| First published | 2015-05-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.8.0 |
| Dependencies | 5 |
| Known vulnerabilities | 0 (+4 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | HAKASHUN |
| Maintainers | hakashun |
| Keywords | gulpplugin |

## Links

- npm: https://www.npmjs.com/package/gulp-git-staged
- Repository: https://github.com/HAKASHUN/gulp-git-staged
- Issues: https://github.com/HAKASHUN/gulp-git-staged/issues
- npm.io page: https://npm.io/package/gulp-git-staged

## Dependencies (5)

- [lodash](https://npm.io/package/lodash.md) ^2.4.1
- [gulp-git](https://npm.io/package/gulp-git.md) ^1.2.4
- [through2](https://npm.io/package/through2.md) *
- [gulp-util](https://npm.io/package/gulp-util.md) ~2.2.0
- [neo-async](https://npm.io/package/neo-async.md) ^1.2.0

## Recent versions

- 0.0.1 (latest) — 2015-05-26

## README

# gulp-git-staged

> git-staged plugin for [gulp](https://github.com/wearefractal/gulp)

## TODO

WIP: This gulp plugin is a work in progress. 

- Add more test for this plugin.

## Usage

You can get an object stream of git staged files on git.

First, install `gulp-git-staged` as a development dependency:

```shell
npm install --save-dev gulp-git-staged
```

Then, add it to your `gulpfile.js`:

```javascript
var gitStaged = require("gulp-git-staged");

gulp.src("./src/*.ext")
	.pipe(gitStaged())
	.on('data', function (file) {
    console.log("Staged file:", file);
  });
```

## API

### git-staged(options)

#### options.status
Type: `String`  
Default: `AMRC`

What status mode to look for.

```bash
A = added
M = modified
R = renamed
C = copied
```

## EXAMPLE

We use this plugin for pre-commit task.

```javascript
gulp.task('pre-commit', function(done) {
	gulp.src('./**/*')
			.pipe(gitStaged())
			.pipe(jshint())
			.pipe(jsbeautifier({
					config: '.jsbeautifyrc',
					mode: 'VERIFY_AND_WRITE'
			}))
			.pipe(gulp.dest('dest'))
			.pipe(git.add());
});			
```

## License

[MIT License](http://en.wikipedia.org/wiki/MIT_License)

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