# ds300/patch-package

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/ds300-patch-package).**

11,098 stars · 319 forks · TypeScript · mit

## Links

- GitHub: https://github.com/ds300/patch-package
- awesome-repositories: https://awesome-repositories.com/repository/ds300-patch-package.md

## Topics

`dependencies` `dependency-manager` `diff` `javascript` `javascript-tools` `node` `node-js` `node-modules` `nodejs` `package-management` `package-manager` `patch` `patcher` `postinstall`

## Description

Patch-package is a utility that extends JavaScript package managers to capture and reapply local modifications made to installed third-party dependencies. By generating standard diff files from changes made directly to the source code on disk, it allows developers to maintain custom fixes across dependency updates and team environments without the need to fork or publish modified versions of external libraries.

The tool integrates directly into the package manager lifecycle, automatically applying stored patches after dependencies are installed or updated. It supports complex maintenance scenarios by allowing multiple patches per dependency, providing mechanisms to revert changes, and offering configurable storage locations for patch files.

To ensure consistency across environments, the system includes features for conditional patch application and production exclusion, which prevent specific modifications from affecting production builds. It also provides error reporting to notify developers if a patch fails to apply, ensuring that any conflicts are identified during the build process.

## Tags

### Development Tools & Productivity

- [Node.js Dependency Patchers](https://awesome-repositories.com/f/development-tools-productivity/dependency-managers/installation-resolution-utilities/dependency-installers/node-js-dependency-patchers.md) — Captures and reapplies local modifications to Node.js dependencies as diff files.
- [Dependency Patching Utilities](https://awesome-repositories.com/f/development-tools-productivity/dependency-patching-utilities.md) — Provides a utility to capture and reapply local modifications to third-party dependencies automatically. ([source](https://github.com/ds300/patch-package/blob/master/package.json))
- [Package Manager Extensions](https://awesome-repositories.com/f/development-tools-productivity/package-managers/package-manager-extensions.md) — Extends JavaScript package managers to maintain custom fixes for third-party code.
- [Dependency Override Managers](https://awesome-repositories.com/f/development-tools-productivity/package-dependency-managers/dependency-override-managers.md) — Manages local overrides for installed dependencies to ensure consistent project behavior.
- [Dependency Maintenance Utilities](https://awesome-repositories.com/f/development-tools-productivity/third-party-integrations/dependency-maintenance-utilities.md) — Maintains custom code fixes to installed packages across updates.
- [Build Pipeline Integrations](https://awesome-repositories.com/f/development-tools-productivity/workflow-automation-tools/build-task-automation/build-pipeline-integrations.md) — Integrates patch application into the software build pipeline.

### DevOps & Infrastructure

- [Installation Hooks](https://awesome-repositories.com/f/devops-infrastructure/installation-hooks.md) — Integrates with package manager lifecycle hooks to automatically apply patches after installation.

### Software Engineering & Architecture

- [Code Patching Engines](https://awesome-repositories.com/f/software-engineering-architecture/code-patching-engines.md) — Modifies installed dependency source code directly on disk using text-based diffs.
- [Patch Generators](https://awesome-repositories.com/f/software-engineering-architecture/code-patching-engines/patch-generators.md) — Generates standard diff files from local modifications for versioning and sharing. ([source](https://github.com/ds300/patch-package#readme))
- [Atomic Patch Appliers](https://awesome-repositories.com/f/software-engineering-architecture/code-patching-engines/patch-generators/automated-patch-appliers/atomic-patch-appliers.md) — Provides atomic, reversible patch application to prevent dependency corruption during build processes.
