npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@groupdocs/groupdocs.comparison

v25.11.0

Published

Document comparison API to diff PDF, DOCX, XLSX, PPTX and other the most popular document formats using JavaScript.

Downloads

18

Readme

Powerful document comparison API for Node.js (powered by Java) to diff 50+ document and image formats, including Microsoft Office and OpenDocument types, PDF documents, and common raster images (TIFF, JPEG, GIF, PNG, BMP). Retrieve changes in a convenient format with line-by-line comparison of content, paragraphs, characters, styles, shapes, and positions.

Quick links

Key Features

  • Compare files or folders and detect differences in similar documents.
  • Visually represent, list, approve, or reject changes.
  • Popular document formats such as PDF, DOCX, PPTX, and XLSX are supported.

Supported Formats

Microsoft Office Formats

  • Microsoft Word: DOC, DOCM, DOCX, DOT, DOTM, DOTX, RTF
  • Microsoft Excel: XLS, XLT, XLSX, XLTM, XLSB, XLSM
  • Microsoft PowerPoint: POT, POTX, PPS, PPSX, PPTX, PPT
  • Microsoft OneNote: ONE
  • Microsoft Visio: VSDX, VSD, VSS, VST, VDX

Other Supported Formats

  • OpenDocument: ODT, ODP, OTP, ODS, OTT
  • Portable: PDF
  • AutoCAD: DWG, DXF
  • Email: EML, EMLX, MSG
  • Images: BMP, GIF, JPG, JPEG, PNG, DICOM
  • Web: HTM, HTML, MHT, MHTML
  • Text: TXT, CSV
  • eBook: MOBI, DJVU

Getting Started

Prerequisites

  • Node.js (LTS recommended)
  • Java Runtime Environment (JRE) 8 or later
  • Windows, Linux, or macOS

Installation

To install the package, check the System Requirements and Installation documentation topics for platform-specific instructions.

Use cases

Here are some typical use cases:

Compare files

This example shows how to compare two DOCX files and save a diff file.

'use strict';

const groupdocs = require('@groupdocs/groupdocs.comparison');

// Apply license, required for non-evaluation usage
const license = new groupdocs.License();
license.setLicense("GroupDocs.Comparison.lic");

// Compare documents
const comparer = new groupdocs.Comparer("proposal_v1.docx");
comparer.add("proposal_v2.docx");
comparer.compare("proposal_diff.docx");

// Exit
process.exit(0);

The output proposal_diff.docx file shows changes made in the second version of the file and lists all the changes on an additional summary page.

Get changes

'use strict';

const groupdocs = require('@groupdocs/groupdocs.comparison');

// Apply license, required for non-evaluation usage
const license = new groupdocs.License();
license.setLicense("GroupDocs.Comparison.lic");

// Compare documents
const comparer = new groupdocs.Comparer("proposal_v1.docx");
comparer.add("proposal_v2.docx");
comparer.compare();

// Print out changes
const changes = comparer.getChanges();
for (let index = 0; index < changes.length; index++) {
	const change = changes[index];

	const page = change.getPageInfo().getPageNumber();
	const type = change.getType().name();
	const text = (change.getText() || "").trim();
	const src = (change.getSourceText() || "").trim();
	const tgt = (change.getTargetText() || "").trim();

	console.log(`[Page ${page}] ${type} "${text}", "${src}" -> "${tgt}"`);
}

// Exit
process.exit(0);

This code example compares two DOCX files and outputs details on changes, such as page, change type, source, and changed text. See the expected console output:

[Page 3] INSERTED "7", "$12 per user/month" -> "$7 per user/month"
[Page 3] DELETED "12", "$12 per user/month" -> "$7 per user/month"
[Page 3] DELETED "5", "$25 per user/month" -> "$20 per user/month"
[Page 3] INSERTED "0", "$25 per user/month" -> "$20 per user/month"

Accept or reject changes

This code example shows how to accept or reject changes between two versions of the same document.

'use strict';

const java = require('java');

const groupdocs = require('@groupdocs/groupdocs.comparison');

// Apply license, required for non-evaluation usage
const license = new groupdocs.License()
license.setLicense("GroupDocs.Comparison.lic");

// Compare documents
const comparer = new groupdocs.Comparer("proposal_v1.docx");
comparer.add("proposal_v2.docx");
comparer.compare();

// Accept all chanes
const changes = comparer.getChanges();
for (let index = 0; index < changes.length; index++) {
	const change = changes[index];
	change.setComparisonAction(groupdocs.ComparisonAction.ACCEPT); // or REJECT
}

// Apply changes and save result
const changeArray = java.newArray('com.groupdocs.comparison.result.ChangeInfo', changes);
const saveOptions = new groupdocs.ApplyChangeOptions(changeArray);
comparer.applyChanges("proposal_accepted_changes.docx", saveOptions);

// Exit
process.exit(0);

This example accepts all the changes and saves the output file with all changes accepted.

Troubleshooting

  • Download during installation fails (corporate proxy/firewall): Ensure your environment allows downloading the required JAR during postinstall. If needed, download the file manually to the lib/ directory as described in the Installation Guide.
  • Java not found: Make sure Java (JRE 8+) is installed and available on your system PATH.
  • Permission issues when writing output files: Verify your process has write access to the target directory.

Licensing

For testing without trial limitations, you can request a 30-day Temporary License:

  • Visit the Get a Temporary License page
  • Follow the instructions to request your temporary license
  • Copy the license file and apply it using the code example
'use strict';

const groupdocs = require('@groupdocs/groupdocs.comparison');

// Apply license
const license = new groupdocs.License();
license.setLicense("GroupDocs.Comparison.lic");

This product is licensed under the GroupDocs End User License Agreement (EULA). For pricing information, visit the GroupDocs.Comparison for Node.js via Java pricing page.

Support

GroupDocs provides unlimited free technical support for all of its products. Support is available to all users, including evaluation. The support is provided at Free Support Forum, Paid Support Helpdesk and Paid Consulting.

Free Support Forum

The GroupDocs Free Support Forum is available to all users and provides:

  • Direct access to the GroupDocs.Total development team
  • Community-driven support and knowledge sharing
  • No time limitations on support requests
  • Access to historical solutions and discussions

Paid Support Helpdesk

The Paid Support Helpdesk offers:

  • Higher priority response times
  • Dedicated support team
  • Extended support hours
  • Priority issue resolution

Paid Consulting

We can work together with you on your project and develop a part or complete application. If you need new features in the existing GroupDocs product or to create API for new file formats, send us a request at consulting.groupdocs.com/contact.


Home | Product Home | Documentation | Blog | Code Samples | Free Support | Temporary License | Pricing