file-patch

0.3.0 • Public • Published

file-patch

Command line diff / patch tool for https://github.com/google/diff-match-patch

npm version

file-patch can compare and modify any text base files in any operating system.

If you have modified some part of your dependent modules or libraries (modified certain block in apache config, change color for blog theme...) file-patch can reduce your effort to maintain and upgrade these files.

Install

You can install it via npm

npm install file-patch

Usage

After install the package provides file-diff and file-patch commands. They can be used to compare and modify any text base files.

Examples

You can find some examples in the source repo. Each example contain 3 files:

  • the origin file
  • the modified file (with -mod mid-fix)
  • the diff file (with .diff subfix)

You can run npm run examples-diff command to genereate .diff file via file-diff. Or run npm run examples-patch command to make the origin file exactly the same as the modified file.

file-diff

file-diff can compare 2 files and generate the diff-style file.

$ file-diff file1 file2

will generate file1.diff near file1

file-patch

file-patch can apply the diff file to the target file.

$ file-patch file1.diff file

will apply patch file (file1.diff) to file1.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.3.0
    331
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.3.0
    331
  • 0.2.1
    0
  • 0.2.0
    0
  • 0.1.1
    0
  • 0.1.0
    0

Package Sidebar

Install

npm i file-patch

Weekly Downloads

331

Version

0.3.0

License

MIT

Unpacked Size

8.34 kB

Total Files

13

Last publish

Collaborators

  • gasolin