Skip to content

Instantly share code, notes, and snippets.

@wires
Created September 28, 2015 08:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wires/ce12df2a8dd1cb6f7814 to your computer and use it in GitHub Desktop.
Save wires/ce12df2a8dd1cb6f7814 to your computer and use it in GitHub Desktop.
var fs = require('fs')
var diff = require('diff-utility');
var f1 = '/tmp/diff-1'
var f2 = '/tmp/diff-2'
fs.writeFileSync(f1, "abcdef".split('').join('\n'))
fs.writeFileSync(f2, "cdefgh".split('').join('\n'))
diff(f1, f2, {stream: true}).ratelimit(1,1000).each(function(obj){
console.log(obj);
})
{
"name": "diff-backpressure",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "Jelle 'wires' Herold",
"license": "AGPL-1",
"dependencies": {
"diff-utility": "wires/node-diff-utility"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment