Installation
npm install @keydown-app/ts-gitpnpm add @keydown-app/ts-gityarn add @keydown-app/ts-gitOptional Dependencies
Section titled “Optional Dependencies”CLI Support
Section titled “CLI Support”The package also exports an optional embedded terminal command surface:
npm install @keydown-app/ts-gitThen import the CLI components:
import { CommandParser } from '@keydown-app/ts-git/cli';Diff Algorithm
Section titled “Diff Algorithm”For diff functionality, you’ll need a line diff algorithm:
npm install @keydown-app/ts-git-diff-myersUsage:
import { myersLineDiff } from '@keydown-app/ts-git-diff-myers';import { GitClient, MemoryFSAdapter } from '@keydown-app/ts-git';
const git = new GitClient({ fs: new MemoryFSAdapter(), dir: '/my-repo', lineDiffAlgorithm: myersLineDiff,});TypeScript Configuration
Section titled “TypeScript Configuration”TS-Git is written in TypeScript and includes type definitions. No additional @types package is needed.
{ "compilerOptions": { "module": "ESNext", "moduleResolution": "bundler", "target": "ES2020" }}Next Steps
Section titled “Next Steps”- Quick Start - Create your first repository