@ebsolutions/git-my-files
v1.1.10
Published
Retrieves all file paths and their status from the git status log
Downloads
22
Maintainers
Readme
Git My Files
This package is used to find the full file path and status of any files that will show up in the git status
command. If a file is moved from one folder to another, it will show one record for the delete and one for the addition.
Example return value:
The package returns an array with the files found and their git status.
[
{ filename: "/folder/path/newfile.js", status: "A" }, // Added
{ filename: "/folder/path/modified-file.js", status: "M" }, // Modified
{ filename: "/folder/path/deleted-file.js", status: "D" } //Deleted
{ filename: "/old/folder/path/moved-file.js", status: "D" } // Moved
{ filename: "/new/folder/path/moved-file.js", status: "A" } // Moved
];
Usage
Install the package using npm or yarn:
npm install @ebsolutions/git-my-files
or
yarn add @ebsolutions/git-my-files
Import the method and call it with the folder path you would like to review or leave empty to inspect all files in project root directory:
const gitChangedFiles = require("@ebsolutions/git-my-files"); /// Check specified folder path gitChangedFiles("/folder-path-to-files"); /// Check project root directory gitChangedFiles();