Skip to content
Run a command on staged files matching a pattern
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin
.gitignore
README.md
index.js
package.json

README.md

staged-files

Get staged files for use in git hooks or some task runner.

API

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

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

Vinyl compatible stream.

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

stagedFiles()
  .pipe(fs.src(['**/*.js'], { passthrough: true }))
  .pipe(fs.dest('./output'));
You can’t perform that action at this time.