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

@mobdata/little-differ-react

v1.0.3

Published

A diff and merge react component for JSON docs!

Downloads

5

Readme

little-differ-react

This is a react component built using TypeScript for the manual process of diffing and merging JSON documents. This application allows users to easily see differences among documents as well as select the elements that should be put into the resulting revised document.

To install the required dependencies, run npm install.

To build the project, run npm run build. This will transpile the TypeScript source into a CommonJS bundle in the build directory. To run the test suite, run npm run test. This will compare expected appOutput with set document inputs for testing.

You can test the project locally by opening the file public/index.html in your web browser.

Little Differ React displays the results of the little-differ compareTripleJson function.

Little Differ React will display three versions of the same document in a side-by-side merge panel view. The left and right sides display new versions of a document that conflict with each other and need to be manually merged. The middle panel displays the original ancestor to both modifications of the document.

The side-by-side merge panel view is designed to show what is different among all three versions of the document. Discrepancies between Document A and the Original document are displayed in blue, and those between Document B and the Original, are displayed in red.

Below the Merge Panel view is the Revised Document panel.

The Revised Document is pre-loaded with the elements that are equal among all three documents so that the user does not need to select them. The user will merge the documents by clicking on the desired elements to be inserted into the Revised Document. Each element in the merge panel view is available for selection. When the user clicks one of the elements, the selected element will immediately appear in the Revised Document.

Buttons are also provided for the user to choose not to select individual keys and accept any of the documents as the Revised Doc.

Usage

In a prototypical example, you will have three versions of one document in JSON format. These are the "original" document and two conflicting versions of that document that need to be merged. After merging the documents into a "Revised Document," the user will click on a custom text button to a callback method of your choice in order to set the Revised Document in your component. The AppComponent from Little-Differ-React will take six props including the original document, the 'docA' version, the 'docB' version, the ID of the document, the custom button text for your component, and the callback method that will accept the revisedDocument in your component.

Please Note: Little-Differ-React expects that each document will have a _rev key indicating the revision id of each document. If you are using CouchDb, this is standard.

import AppComponent from '@mobdata/little-differ-react/'


function changeRevisedDataForCaller(value: object) {
  // eslint-disable-next-line prefer-template
  // Method called in the callback when the Accept Final button is clicked 
  // for you to handle the revised doc however you want.
  console.log('Revised Data retrieved by caller: ' + JSON.stringify(value));
}

ReactDOM.render(

  <AppComponent
    orig={original3}
    docA={documentA3}
    docB={documentB3}
    selectedDoc={1}
    acceptFinalButtonText="Push Current Buffer(Change this text)"
    changeRevisedDataForCaller={(doc) => changeRevisedDataForCaller(doc)}
  />,
  document.getElementById('root'),
)