This is a library to interact programmatically with git in typescript for node.
$ yarn add @mscs/git
Short example:
import { open, RepositoryInterface, BranchInterface } from "@mscs/git";
async function runtime() {
const repository: RepositoryInterface = open("/path/to/repo");
const branches: BranchInterface[] = await repository.getBranches();
for (const branch of branches){
console.log(branch.getName());
}
}
runtime().catch(error => {
console.log(error);
process.exit(1);
});