Skip to content
This repository has been archived by the owner on Nov 26, 2021. It is now read-only.
/ redis-diff Public archive

Perform a diff comparison backed by redis.

License

Notifications You must be signed in to change notification settings

Kikobeats/redis-diff

Repository files navigation

redis-diff

Last version Build Status Coverage Status Dependency status Dev Dependencies Status NPM Status Donate

Perform a difference comparison backed by redis.

Install

$ npm install redis-diff --save

Usage

const diff = createDiff()
const noop = () => {}

diff.set({
  key: 'mykey',
  value: [
    { id: 1, foo: 'bar' },
    { id: 1, foo: 'barz' },
    { id: 1, foo: 'baaz' }
  ]
}, noop)

diff.compare({
  key: 'mykey',
  value: [
    { id: 1, foo: 'bar' },
    { id: 1, foo: 'baarz' },
    { id: 1, foo: 'bax' }
  ],
  ids: ['id', 'foo']
}, console.log)

// {
//   added: [ { id: 1, foo: 'baarz' }, { id: 1, foo: 'bax' } ],
//   removed: [ { id: 1, foo: 'barz' }, { id: 1, foo: 'baaz' } ],
//   common: [ { id: 1, foo: 'bar' } ]
// }

License

MIT © Kiko Beats.

About

Perform a diff comparison backed by redis.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •