Npm wrapper that ships pre-extracted patch binaries and exposes them via the package bin entry (patch). Currently includes the GnuWin32 build; the structure allows adding other platforms.
- Global (adds
patchto PATH via npm's global bin):npm install -g gnu-patch - Project-scoped (available via
npx patchornode_modules/.bin/patch):npm install gnu-patch
bin/win32/patch.exe— bundled GnuWin32 binary.bin/win32/docs/— upstream docs and man pages (patch.1.txt,patch.1p.txt,AUTHORS,COPYING,ChangeLog).- Entry point:
index.js(wired viapackage.jsonbinfield topatch).
- Currently ships only the Windows binary; additional platforms can be added under
bin/<platform>/. - Until other binaries are added, non-Windows hosts will exit with an explanatory error.
- On Windows,
scripts/postinstall.jsonly verifies thatbin/win32/patch.exeexists; there are no downloads or extractions. - On non-Windows hosts, postinstall prints a skip notice and exits.
- Global install:
patch --versionshould work immediately (npm global bin is typically on PATH on Windows). - Local install: use
npx patchornode_modules/.bin/patch(no system PATH changes). - If
patch.exeever goes missing, runnpm rebuild gnu-patchor reinstall to restore bundled files.
MIT