An event and Promise based JavaScript parser and render (to HTML) for unified diff files.
JavaScript CSS
Latest commit 6a94fde Oct 1, 2016 @markcarver markcarver Moar work
Permalink
Failed to load latest commit information.
dist
src
.eslintrc Moar work Nov 7, 2016
.gitignore
Gruntfile.js Moar work Nov 7, 2016
LICENSE-MIT Initial commit of Dreditor 2.0.0 Sep 20, 2016
README.md
package.json Moar work Nov 7, 2016

README.md

Dreditor

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

// Get a patch from somewhere on the file system.
var string = require('fs').readFileSync('./some-unified-diff.patch', 'utf8');

// Create a new Dreditor instance.
var dreditor = require('dreditor')();

dreditor
  // Parse the data.
  .parse(string)
  .then(function (/** @type {Parser} */ parser) {
    // Do stParserer.render();
  })
  .then(function (/** @type {Element} */ output) {
    output.addClass('my-custom-class');
    console.log(output.toString());
  });