Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jpommerening/staged-files

Run a command on staged files matching a pattern
https://github.com/jpommerening/staged-files

Last synced: 24 days ago
JSON representation

Run a command on staged files matching a pattern

Awesome Lists containing this project

README

        

# staged-files

> Get staged files for use in [git hooks](https://github.com/gtramontina/ghooks) or some task runner.

## API

From the command line (mostly useful for systems without `xargs`).

```console
staged-files 'optional-pattern/**' -- optional_command
```

[Vinyl](https://github.com/gulpjs/vinyl-fs) compatible stream.

```js
var fs = require('vinyl-fs');
var stagedFiles = require('staged-files');

stagedFiles()
.pipe(fs.src(['**/*.js'], { passthrough: true }))
.pipe(fs.dest('./output'));
```