redis-diff

3.0.0 • Public • Published

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.

Package Sidebar

Install

npm i redis-diff

Weekly Downloads

0

Version

3.0.0

License

MIT

Unpacked Size

7.91 kB

Total Files

5

Last publish

Collaborators

  • kikobeats