Giter VIP home page Giter VIP logo

patch-files's Introduction

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-files patch-package
4.1kb minified + gzipped as of v6.0.0 124.8kb minified + gzipped as of v6.5.0
0 dependencies 14 dependencies
Downloads individual file(s) for comparison Downloads entire npm modules for comparison
Does not depend on Git Depends on Git
Relies on CDNs jsdelivr or unpkg Relies on the npm registry
Requires Node 18 or greater Requires Node 10 or greater

patch-files's People

Contributors

tyhopp avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.