mikolalysenko/patcher.js — Issue #4: JSON Patch?
Author: NV
Created: 2012-01-10 13:42:20+00:00
State: open

Have you considered using [JSON Patch](http://tools.ietf.org/html/draft-pbryan-json-patch-04). It’s more efficient when it comes to patch size.

```javascript
> require('patcher').computePatch([1,2,3,4,5], [2,3,4,5])
{ '0': 2,
'1': 3,
'2': 4,
'3': 5,
'$r': 4 }
```

JSON Patch using [remove operation](http://tools.ietf.org/html/draft-pbryan-json-patch-04#section-4.2):

```javascript
{ "remove": "0" }
```

It also has handy add, move, and replace operations.

https://github.com/bruth/jsonpatch-js is a partial implementation (applies patches, doesn’t yet generate them).