Prerequisites
Before installing useGit, ensure you have the following:- Node.js 18 or higher
- Git installed on your system
useGit is a Node.js wrapper around Git commands, so Git must be installed and accessible in your PATH.
Package Installation
Install useGit using your preferred package manager:Verify Installation
After installation, verify that useGit can detect your Git installation:TypeScript Support
useGit is written in TypeScript and includes full type definitions out of the box. No additional@types packages are needed.
TypeScript Configuration
For the best experience, ensure yourtsconfig.json includes:
tsconfig.json
Import Styles
useGit supports both ES modules and CommonJS:Package Exports
The package provides the following exports:git- Default Git instance with current working directorycreateGit(options)- Factory function to create custom Git instances- All Git operation functions can be imported individually if needed
Next Steps
Quick Start Guide
Learn how to use useGit with a practical example