https://github.com/slammayjammay/git-diff-glob
An easy way to get a diff using a file glob.
https://github.com/slammayjammay/git-diff-glob
babel es6 javascript node
Last synced: about 2 months ago
JSON representation
An easy way to get a diff using a file glob.
- Host: GitHub
- URL: https://github.com/slammayjammay/git-diff-glob
- Owner: slammayjammay
- License: mit
- Created: 2017-01-12T23:07:25.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-02-02T06:45:40.000Z (over 9 years ago)
- Last Synced: 2025-07-04T18:51:22.622Z (12 months ago)
- Topics: babel, es6, javascript, node
- Language: JavaScript
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `git-diff-glob`
> An easy way to get a diff using a file glob.
# Usage
Require and call the function providing a file "glob", a substring of a file that you want the diff of. `git-diff-glob` will look for all files that include the given substring, and return a string of the diff for all matching files.
By default, matches will be made case-insensitively. This can be overwritten by providing an options argument `{ caseSensitive: true }`
```js
const gitDiffGlob = require('git-diff-glob')
let diff
// provide a string for a diff of all files matching 'READ'
// (e.g. README.md)
diff = gitDiffGlob('READ', { caseSensitive: true })
// or provide a space--deliminated string of multiple substrings
diff = gitDiffGlob('index html')
// or provide an array of substrings
diff = gitDiffGlob(['index', 'html'])
console.log(diff)
```