6.0.4 • Published 2 years ago

patch-files v6.0.4

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

patch-files

Create and apply patches for file changes in node_modules.

A small (4.1kb minified + gzipped), fast alternative to patch-package. See the table of differences below.

Usage

Keep in mind that patch-files:

  • Requires Node 18 or greater
  • Should be run from the root of your project

To create a patch for a single file:

npx patch-files@latest node_modules/a/a.js

To create a patch for multiple files:

npx patch-files@latest node_modules/a/a.js,node_modules/b/b.js

To apply patches:

npx patch-files@latest

Two directories are created:

  • patch-files is where patch files are written
  • patch-files-cache is where the files fetched for comparison are written

You can apply patches in a postinstall script so patches are applied whenever you install your node modules:

{
  "scripts": {
    "postinstall": "npx patch-files@latest"
  }
}

How is patch-files different from patch-package?

patch-filespatch-package
4.1kb minified + gzipped as of v6.0.0124.8kb minified + gzipped as of v6.5.0
0 dependencies14 dependencies
Downloads individual file(s) for comparisonDownloads entire npm modules for comparison
Does not depend on GitDepends on Git
Relies on CDNs jsdelivr or unpkgRelies on the npm registry
Requires Node 18 or greaterRequires Node 10 or greater
6.0.4

2 years ago

6.0.3

2 years ago

6.0.2

2 years ago

6.0.1

2 years ago

6.0.0

2 years ago

5.0.0

2 years ago

4.0.0

2 years ago

3.0.0

2 years ago

2.0.2

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.0.0

2 years ago