json-diff-patch-stream

send json diffs and patches with two transform streams

Usage no npm install needed!

<script type="module">
  import jsonDiffPatchStream from 'https://cdn.skypack.dev/json-diff-patch-stream';
</script>

README

JSON-diff-patch-stream

Two transform streams to send JSON diffs and parse JSON patches

installation

$ npm install --save json-diff-patch-stream

use

const createDiffSource = require('json-diff-patch-stream').createSource
const diffSource = createDiffSource() // Transform stream

process.stdin.pipe(diffSource).pipe(process.stdout)

get approximately this:

$ node myStream.js
{"a":2} # prints { a: [2] }