Socket
Socket
Sign inDemoInstall

diffable-html

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

diffable-html

Opinionated HTML formatter focused towards making HTML diffs readable.


Version published
Maintainers
1
Created

What is diffable-html?

The diffable-html npm package is designed to help developers compare and visualize differences between HTML documents. It is particularly useful for testing and debugging purposes, allowing users to see what has changed between two versions of an HTML document.

What are diffable-html's main functionalities?

HTML Comparison

This feature allows you to compare two HTML strings and get a diff representation of the changes. The code sample demonstrates how to use the diffable-html package to compare two HTML documents and output the differences.

const diffableHtml = require('diffable-html');
const html1 = '<div><p>Hello World</p></div>';
const html2 = '<div><p>Hello Universe</p></div>';
const diff = diffableHtml(html1, html2);
console.log(diff);

Customizing Diff Output

This feature allows you to customize the output of the diff by passing options. The code sample shows how to enable wrapping of the diff output by passing an options object.

const diffableHtml = require('diffable-html');
const html1 = '<div><p>Hello World</p></div>';
const html2 = '<div><p>Hello Universe</p></div>';
const options = { wrap: true };
const diff = diffableHtml(html1, html2, options);
console.log(diff);

Other packages similar to diffable-html

Keywords

FAQs

Package last updated on 03 Jan 2018

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc