Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

patchr

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

import fs from 'fs';
import { Patchr } from 'src/js';

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

// Create a new patchr instance.
const patchr = new Patchr();

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