An open API service indexing awesome lists of open source software.

https://github.com/nice-digital/file-diff-generator

Generates colourised differences between any kinds of files from two different sources and indicates if they were added, deleted or changed.
https://github.com/nice-digital/file-diff-generator

Last synced: 11 months ago
JSON representation

Generates colourised differences between any kinds of files from two different sources and indicates if they were added, deleted or changed.

Awesome Lists containing this project

README

          

File Diff Generator
==================
![Icon](icon.png)

---

## Installing

```bash
npm install file-diff-generator
```

## What is it?

`file-diff-generator` generates colourised differences between any kinds of files from two different sources and indicates if they were added, deleted or changed.

The added, deleted or changed files are collated into the output folder with the adddition of a file called `filesList.html` which contains hyperlinks to the relevant files in the output directory. This is useful if the output needs to be rendered by a web server.

### Changed file
![Changed](changed.png)

### Added file
![Added](added.png)

### Deleted File
![Deleted](deleted.png)

### Options
```
Usage:

file-diff-generator --new= NEW SOURCE --old= OLD SOURCE --output= DESTINATION [OPTIONS]

--outputFormat Whether to display the differences line-by-line or side-by-side (default: line-by-line)

--regexReplacement An array of regular expressions in JSON to replace text in source files (default: none)

--merge Whether to merge all the output files into a single file called allResults.html (default: false)
```

### Usage Examples

```bash
file-diff-generator --new=/root/new --old=/root/old --output=/root/output --outputFormat=side-by-side
```

```bash
file-diff-generator --new=/root/new --old=/root/old --output=/root/output merge=true
```

```bash
file-diff-generator --new=/root/new --old=/root/old --output=/root/output --regexReplacement='[{ regex: /build.1278/, replacement: \"\" }]'
```

Icon made by Freepik from www.flaticon.com