New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

xlsx-diff

Package Overview
Dependencies
Maintainers
0
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xlsx-diff

Custom git diff driver for Microsoft Excel .XLSX files

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
0
Created
Source

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"
        
  • 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.

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

To-Do

  • Build binaries so this can be used without NodeJS.
  • Better way of working out headers for the visual diff.
  • ???

FAQs

Package last updated on 24 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts