node-fs-repo
This is part of the ES-Git project.
Install
npm install --save @es-git/node-fs-repo
Usage
This is an implementation of IRawRepo
that uses the file system for storage. It uses the node fs and therefore really only works on the server. Use this to interface with an existing git repo created with the git cli.
important: you should use the zlib-mixin
if you want to load an existing git repo created with the git cli.
import Repo from '@es-git/node-fs-repo';
const repo = new Repo(__dirname + '/.git');
await repo.init();
constructor(path : string)
Creates the repository instance. The path parameter points to a location in the filesystem where either a repo already exists or a new one should be made.
init() : Promise<void>
Initialize a new empty repository at the path provided in the constructor.