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 🙏

© 2025 – Pkg Stats / Ryan Hefner

mizunie-compare-pdf

v1.0.3

Published

A library for comparing PDF files and generating visual diffs

Readme

mizunie-compare-pdf 📄🔍

Una librería para comparar archivos PDF y generar diferencias visuales con reportes detallados. Desarrollado por Mizunie.

Características

  • ✅ Comparación página por página
  • ✅ Generación de imágenes con diferencias resaltadas
  • ✅ Reportes detallados en consola
  • ✅ Soporte para TypeScript
  • ✅ Alto rendimiento con procesamiento optimizado

Requisitos del sistema

  • Node.js 22.15.0 o superior
  • npm 8.0.0 o superior

¿Por qué Node.js 22.15+?

Utilizamos las últimas características de ES2022 y módulos de Node.js para garantizar máximo rendimiento y estabilidad. Versiones inferiores pueden presentar problemas de compatibilidad.

Instalación

npm i mizunie-compare-pdf

Uso básico

import { PDFComparator } from 'mizunie-compare-pdf';

async function main() {
  const comparator = new PDFComparator();
  
  try {
    const result = await comparator.comparePDFs(
      './src/test-pdfs/File3.pdf',
      './src/test-pdfs/File4.pdf',
      {
        highlightColor: { r: 255, g: 0, b: 0 },
        debug: true
      }
    );
    
    console.log('\nResultados:');
    console.log('¿Son iguales?', result.areEqual);
    console.log('Diferencias totales:', result.totalDifferences);
    console.log('Resumen:', result.summary);
    
    comparator.generateDetailedReport(result);
    console.log(result.pageResults);
  } catch (error) {
    console.error('❌ Error:', error);
  }
}

main();

Resultado

La comparación devuelve un objeto con:

Loading PDFs...
- 1: File3.pdf
- 2: File4.pdf
- comparing: pdf1_page-1.png and pdf2_page-1.png
- comparing: pdf1_page-2.png and pdf2_page-2.png
 - Diffs: 2528 pixels (0.04%)

📊 Resultados:
¿Son iguales? false
Diferencias totales: 1
Resumen: x 1 pages with diffs (0.04% max)

Details
==================================
General: Have diffs
Pages diffs: 1

Details per page:
   Page 1: Yes 0.00% dif
   Page 2: No 0.04% dif
        Diff image: diff_page_2.png

[
  {
    pageNumber: 1,
    areEqual: true,
    diffPercentage: 0,
    diffPixels: 0,
    totalPixels: 5843750,
    diffImagePath: undefined
  },
  {
    pageNumber: 2,
    areEqual: false,
    diffPercentage: 0.04325989304812834,
    diffPixels: 2528,
    totalPixels: 5843750,
    diffImagePath: 'src\\temp\\diffs\\diff_page_2.png'
  }
]

Soporte de la comunidad

¿Te gusta esta librería? ¡Considera apoyar su desarrollo!

Tu apoyo ayuda a mantener y mejorar esta librería. ¡Gracias! 💖