Pluggable Filesystem
Works with in-memory, browser storage, or native filesystems via adapter pattern
Pluggable Filesystem
Works with in-memory, browser storage, or native filesystems via adapter pattern
Minimal Dependencies
Lightweight core with only essential dependencies. Bring your own diff algorithm.
Well Tested
Comprehensive test suite with 470+ tests
Browser Native
Run Git operations directly in the browser
Type Safe
Fully typed with TypeScript for excellent developer experience
Git Compatible
Standard Git API with familiar commands. Includes interoperability tests to ensure compatibility with existing repositories and the canonical Git CLI.
import { GitClient, MemoryFSAdapter } from '@keydown-app/ts-git';
// Create a filesystem adapterconst fs = new MemoryFSAdapter();
// Initialize Git clientconst git = new GitClient({ fs, dir: '/my-repo' });
// Initialize a repositoryawait git.init({ defaultBranch: 'main' });
// Stage and commit filesawait git.add('README.md');await git.commit('Initial commit', { name: 'John Doe', email: 'john@example.com',});npm install @keydown-app/ts-git