|
1 jaar geleden | |
---|---|---|
.. | ||
test | 1 jaar geleden | |
.npmignore | 1 jaar geleden | |
hooks.json | 1 jaar geleden | |
index.js | 1 jaar geleden | |
package.json | 1 jaar geleden | |
readme.md | 1 jaar geleden |
This module returns an array of staged files and their status acording to git.
Download
npm install staged-git-files
In Code
var sgf = require("staged-git-files");
sgf(function(err, results){
//WHAT EVER YOU SO PLEASE
});
Example Results
[
{
"filename": "package.json",
"status": "Added"
},
{
"filename": "readme.md",
"status": "Modified"
},
{
"filename": "index.js",
"status": "Renamed"
}
]
Get a list of staged git files
Get head that will be used in the diff to ID which files are waiting to be staged.
This is a proxy for fs.readFile with one change. The filename will be relative to the sgf.cwd
Boolean that flips logging on and off. By default this is false. If true, all git commands will be console logged.
If true, include content will add a content
or err
param to the file object.
The current working directory. AKA: where the .git folder you care about is.
SGF-Status (git status code)