An event and Promise based JavaScript parser and render (to HTML) for unified diff files.
importfsfrom'fs';import{Patchr}from'src/js';// Get a patch from somewhere on the file system.conststring=fs.readFileSync('./some-unified-diff.patch','utf8');// Create a new patchr instance.constpatchr=newPatchr();patchr// Parse the data..parse(string).then((/** @type {Parser} */parser)=>{// Parser.render();}).then((/** @type {Element} */element)=>{element.addClass('my-custom-class');console.log(element.toString());});