### Patch format
The patches consist on an array of operations, each one contained in another array:
[
[<path>, <operation>, <argument>],
[<path>, <operation>, <argument>],
...
]
path
- A path in data object to operate. Supports dot notation, like "a.b.c" or "a.b.0".operation
- One of the implemented operations.argument
- Argument for the operation.
### Library usage
This module also provides a class for using in your Node.js application.
var Patcheable = require('japan').Patcheable;
var data = Patcheable({"a":{"b":2},"c":2});
console.log(data.getKey("a.b"));
console.log(data.getKey("a.c.x.z"));
console.log(data.fetch("a"));
console.log(data.put("a.c", 3));
console.log(data.copy("c", "a.b"));
console.log(data.move("a.c", "c"));
console.log(data.remove("c"));
console.log(JSON.stringify(data));
Examples
### Serial patching
$ echo '{"a":1,"c":2}' > data.json
$ echo '[["d.f", "put", 4], ["c", "move", "a.b.c"]]' > patch1.json
$ echo '[["d", "remove"], ["a.b.c", "copy", "d"], ["a.b.c", "put", 5]]' > patch2.json
$ jp patch1.json patch2.json < data.json
{"a":{"b":{"c":5}},"d":2}