xlsx-diff
v0.1.0
Published
Custom git diff driver for Microsoft Excel .XLSX files
Downloads
6
Readme
xlsx-diff
Custom git diff driver for Microsoft Excel .XLSX files
Features
- Git will be better able to calcuate how many changes have been made to your XLSX file.
- Your IDE can display a basic text representation of the file and diff it for you. NOTE THAT IN VSCODE, IT ONLY WORKS IF YOU'VE STAGED THE FILE! (untested on other IDEs)
Requirements
- NodeJS (tested on 14+)
Setup
- Download this package with your preferred package manager:
npm install --dev xlsx-diff
. - Tell git that this driver exists:
- Local:
git config --local diff.xlsx.command "npm xlsx-diff"
git config --local diff.xlsx.textconv "npm xlsx-textconv"
- Global:
- Add to your
.gitconfig
file in your home directory:[diff "xlsx"] command = "npm xlsx-diff" textconv = "npm xlsx-textconv"
- Add to your
- Local:
- Configure your repository to use this diff driver for XLSX files:
- Create a
.gitattributes
file in the root of your repository. - Add the line
*.xlsx diff=xlsx
. - To be safe, also add
*.XLSX diff=xlsx
.
- Create a
API
If you want to diff or textconv a .xlsx file programatically, for whatever reason, you can do that:
import { textconv, diff } from "xlsx-diff";
textconv("myExcelFile.xlsx");
Known Issues and Limitations
- In VSCode, the nicely formatted visual diff will only be displayed if the XLSX file has been staged. This is an issue with VSCode, and not this package, but doesn't seem to be on their backlog as this issue has been closed: https://github.com/microsoft/vscode/issues/168472
Bugs and Requests
- Open up an issue on our GitHub!
To-Do
- Build binaries so this can be used without NodeJS.
- Better way of working out headers for the visual diff.
- ???