redis-diff
v3.0.0
Published
Perform a diff comparison backed by redis.
Downloads
10
Maintainers
Readme
redis-diff
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.