Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/jpommerening/staged-files
- Owner: jpommerening
- Created: 2015-11-24T12:32:01.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-05-13T20:20:19.000Z (over 8 years ago)
- Last Synced: 2024-04-30T05:22:49.797Z (7 months ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 6
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
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'));
```