Installation
node-git-server is a configurable git server written in Node.js. It exposes git
repositories over HTTP and HTTPS and lets you hook into every fetch, push and tag.
Requirements
- Node.js 22 or newer. The package uses modern Node APIs and the
node:protocol. - The
gitbinary must be available on the hostPATH— the server shells out togit-upload-pack/git-receive-packto speak the git wire protocol.
Install
npm i @batchfy/node-git-serverpnpm add @batchfy/node-git-serveryarn add @batchfy/node-git-serverESM only
The package is ESM only — import it, require() is not supported:
import { Git } from "@batchfy/node-git-server"If your project is still CommonJS, either switch your file to ESM ("type": "module"
in package.json) or load it dynamically:
const { Git } = await import("@batchfy/node-git-server")Zero dependencies
The library has no runtime dependencies. All streaming is built on Node's native
node:stream, so installing it pulls in nothing else.