Skip to content

Repository files navigation

patchr

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());});

About

An event and Promise based JavaScript parser and render (to HTML) for [unified] diff/patch files.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages