2.3.0 • Published 8 months ago

@tomsd/github-repo v2.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

@tomsd/github-repo

It's a utility for GitHub.
See github-repo-package.netlify.app for details.

npm NPM

ci checks top language Maintenance depends on node greater or equal 18

installation

npm install @tomsd/github-repo

usage

import GitHub class.

import { GitHub } froom "@tomsd/github-repo";

create an instance

const github = new GitHub(GITHUB_TOKEN);

get repo instance

const repo = github.organization(OWNER).repo(REPO);

instance chainings

const issue = github
  .organization(ORG)
  .repo(REPO)
  .issue(issueNumber);

const pull = repo
  .pull(pullNumber);

fetching data

// call ensureData() of each instance
await repo.ensureData();
await issue.ensureData();
await pull.ensureData();

get branches

await repo.getBranches();

get tags

await repo.getTags();

get branch sha

await repo.getBranchSha("main");

get branch tree

await repo.getBranchTree("main");

get file content

await repo.getFileContent("path/to/file");

create a tag

await repo.createTag("my-tag", "main");

list pull requests

const pulls = await repo.listPulls({ base: "main" });
await Promise.all(pulls.values().map(pull => pull.ensureData()));

list issues

const issues = await repo.listIssues({ state: "all" });
await Promise.all(issues.values().map(issue => issue.ensureData()));
2.3.0

8 months ago

2.2.1

8 months ago

2.2.0

8 months ago

1.9.0

9 months ago

1.8.0

9 months ago

2.1.0

8 months ago

2.0.0

8 months ago

1.7.5

9 months ago

1.7.4

10 months ago

1.7.3

10 months ago

1.7.2

10 months ago

1.7.1

10 months ago

1.7.0

10 months ago

1.6.1

10 months ago

1.6.0

10 months ago

1.5.1

10 months ago

1.5.0

10 months ago

1.3.2

10 months ago

1.4.0

10 months ago

1.3.1

12 months ago

1.3.0

12 months ago

1.2.0

2 years ago

1.1.0

2 years ago

1.2.1

2 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago