Socket
Socket
Sign inDemoInstall

fluid-diff

Package Overview
Dependencies
94
Maintainers
9
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    fluid-diff

A library for describing the differences between two JSON structures.


Version published
Weekly downloads
3
Maintainers
9
Created
Weekly downloads
 

Readme

Source

fluid-diff

This package is designed to "diff" two pieces of data and produce output that can be used to explore the differences.

There is a standard for representing differences between JSON structures as a patch, but the goal there is to produce output that can be used to faithfully "undo" and "redo" a given set of changes.

Our goal is to produce a more expansive structure that includes:

  1. Information that has not changed.
  2. Information that has been removed.
  3. Information that has been added.
  4. Detailed information about changes to a single string.

The focus here is not on changes to the deep structure, only changes in values (strings, numbers, etc.) are represented. This is intended to provide just enough information to present an annotated representation of a given set of changes. For this purpose, there are Handlebars templates provided in this package, which can be used with fluid-handlebars to convert the "diff" JSON structure produced by this package into:

  • text
  • HTML
  • markdown

Installation

To add this package to your project, use a command like npm install --save fluid-diff.

Further Reading

  1. For more details about generating a "diff", see the list of available functions.
  2. For examples of using a "diff" on its own and in combination with handlebars templates, see the tutorial.

FAQs

Last updated on 07 Sep 2021

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc