Dependencies patcher ~ programmatically apply .patch files to your dependencies.
Under the hood, it uses diff.
Install as development dependency:
| Package Manager | Command |
|---|---|
| npm | npm install -D depatcher |
| yarn | yarn add -D depatcher |
| pnpm | pnpm add -D depatcher |
Apply .patch files to specific files within a target dependency.
import { applyPatch } from 'depatcher'
// applyPatch(packageName, patchMap)
await applyPatch('packageName', {
// 'target_file_in_dependency': 'path_to_patch_file'
'/dist/index.js': './packageName_index.patch'
})Create a .patch file using the diff of an original file and a patched file.
import { createPatch } from 'depatcher'
createPatch(
'./original_file.js',
'./patched_file.js',
'./file.patch'
)npmpatch support
Got ideas or want to add a patch string?
- Clone the repository.
- Install dependencies with
yarn install. - Build the project using
yarn build(usestsdown). - Run tests with
yarn test.
This project is licensed under the MIT License.