JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2631
  • Score
    100M100P100Q122649F
  • License MIT

Human Readable Difference Between Two Objects

Package Exports

  • human-object-diff

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (human-object-diff) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

human-object-diff

build status code coverage code style styled with prettier made with lass license npm downloads

Configurable Human Readable Difference Between Two Plain Objects

Table of Contents

Install

npm:

npm install human-object-diff

yarn:

yarn add human-object-diff

Usage

const humanDiff = require('human-object-diff');

const lhs = { foo: 'bar' };
const rhs = { foo: 'baz' };
const options = {};

const diff = humanDiff(lhs, rhs, options);

console.log(humanObjectDiff.renderName());
// -> ['Foo", with a value of "bar" (at Obj.foo) was changed to "baz"']

Support for Dates

human-object-diff uses date-fns format function under the hood to show human readable date differences. We also supply a dateFormat option where you can supply your own date formatting string. Please note, that date-fns format strings are different from moment.js format strings. Please refer to the documentation here and here

Contributors

Name Website
Spencer Snyder http://spencersnyder.io/

License

MIT © Spencer Snyder