🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

patch-package

Package Overview
Dependencies
Maintainers
1
Versions
98
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

patch-package

When forking just won't work, patch it.

Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
3.6M
6.7%
Maintainers
1
Weekly downloads
 
Created
Source

patch-package

When forking just won't work, patch it.

patch-package lets you easily fix bugs in (or add functionality to) packages in your node_modules folder and share the results with your team. You simply make the changes in situ, run patch-package <package-name> and patch-package will create a patch file for you to commit, which gets applied any time the contents of node_modules is updated by yarn/npm.

Set-up

yarn add -D patch-package

In package.json

"scripts": {
  "prepare": "patch-package"
}

Usage

Make changes to the files of a particular module in your node_modules folder, e.g. react-native. Then run:

patch-package react-native

If this is the first time you've used patch-package, it will create a folder called patches in the root dir of your app. Inside will be a file called react-native:0.44.0.patch which is a diff between normal old react-native and your special version. Commit this and you and your team will enjoy the same changes from here on out.

Do exactly the same thing to update the patch file, or just delete it if you don't need the changes anymore.

License

MIT

FAQs

Package last updated on 08 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts