This package contains the GitHub implementation used by the git-filesystem npm package.
Use this to read & write specifically to GitHub repositories only; else use the git-filesystem package to write to repositories hosted with multiple cloud providers.
This package exposes methods for:
-
Creating a repository
-
Deleting a repository
-
Searching for repositories
-
Creating a file
-
Overwriting a file
-
Deleting a file
-
Creating tags
-
Reading files from tags
npm install @git-filesystem/github
import { GitHubClient } from "@git-filesystem/github";
const gitHubClient = new GitHubClient("github-username", "access-token", "user-agent-name");
const gitHubRepository = gitHubClient.getRepository("repository-name");
let fileContent = await gitHubRepository.readFile("file/path.txt");
fileContent += "\n\nNewData";
await gitHubRepository.updateFile("file/path.txt", fileContent);
@git-filesystem/github is licensed under the ISC License.