{"id":16625861,"url":"https://github.com/juunini/github-api-helper-ts","last_synced_at":"2026-04-19T22:02:41.834Z","repository":{"id":153875104,"uuid":"630375741","full_name":"juunini/github-api-helper-ts","owner":"juunini","description":"Helper using GitHub API","archived":false,"fork":false,"pushed_at":"2023-05-01T08:24:56.000Z","size":132,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-18T12:06:18.905Z","etag":null,"topics":["api","github","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/juunini.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-20T08:47:54.000Z","updated_at":"2023-04-24T05:50:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"13eac4e3-b44b-433e-aac5-4300626ac0c9","html_url":"https://github.com/juunini/github-api-helper-ts","commit_stats":{"total_commits":21,"total_committers":1,"mean_commits":21.0,"dds":0.0,"last_synced_commit":"ee16fbd0f6a7990710d8d090696f79772642398b"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juunini%2Fgithub-api-helper-ts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juunini%2Fgithub-api-helper-ts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juunini%2Fgithub-api-helper-ts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juunini%2Fgithub-api-helper-ts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/juunini","download_url":"https://codeload.github.com/juunini/github-api-helper-ts/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243039629,"owners_count":20226132,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","github","typescript"],"created_at":"2024-10-12T04:07:35.070Z","updated_at":"2025-12-24T22:21:26.078Z","avatar_url":"https://github.com/juunini.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# github-api-helper\n\n![TypeScript](https://img.shields.io/badge/TypeScript-007ACC?style=for-the-badge\u0026logo=typescript\u0026logoColor=white)\n![BunJS](https://img.shields.io/badge/Bun-beige?style=for-the-badge\u0026logo=bun\u0026logoColor=black)\n![Parcel](https://img.shields.io/badge/Parcel-deac79?style=for-the-badge\u0026logoColor=black\u0026logo=data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pgo8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDIwMDEwOTA0Ly9FTiIKICJodHRwOi8vd3d3LnczLm9yZy9UUi8yMDAxL1JFQy1TVkctMjAwMTA5MDQvRFREL3N2ZzEwLmR0ZCI+CjxzdmcgdmVyc2lvbj0iMS4wIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiB3aWR0aD0iMzguMDAwMDAwcHQiIGhlaWdodD0iMzAuMDAwMDAwcHQiIHZpZXdCb3g9IjAgMCAzOC4wMDAwMDAgMzAuMDAwMDAwIgogcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCI+Cgo8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgwLjAwMDAwMCwzMC4wMDAwMDApIHNjYWxlKDAuMTAwMDAwLC0wLjEwMDAwMCkiCmZpbGw9IiMwMDAwMDAiIHN0cm9rZT0ibm9uZSI+CjxwYXRoIGQ9Ik0xNzYgMjI1IGMtMyAtOSAtMTIgLTEyIC0yMyAtOSAtMTAgMyAxIC02IDI1IC0yMSBsNDQgLTI3IDI0IDIzIGMyNwoyNSAyMiAzMiAtMzMgNDIgLTIyIDQgLTMzIDIgLTM3IC04eiIvPgo8cGF0aCBkPSJNMTA4IDIwMyBjNyAtMyAxOCAtMTcgMjMgLTMxIDggLTIwIDEyIC0yMyAyMiAtMTMgOSAxMCA3IDE3IC0xMiAzMgotMTMgMTAgLTI4IDE5IC0zNSAxOCAtNiAwIC02IC0zIDIgLTZ6Ii8+CjxwYXRoIGQ9Ik0yODYgMTMxIGMtMyAtNSAwIC0xMSA3IC0xNCA4IC0zIDE0IDEgMTQgOSAwIDE2IC0xMyAxOSAtMjEgNXoiLz4KPHBhdGggZD0iTTE2MCA4NCBjMCAtMTQgNCAtMjMgMTAgLTE5IDYgMyAxMCAyIDEwIC00IDAgLTYgNyAtOCAxNSAtNSA4IDQgMTUKMTUgMTUgMjUgMCAyMSAtMTYgMjYgLTIzIDcgLTMgLTggLTYgLTYgLTYgNSAtMSAyNyAtMjEgMjAgLTIxIC05eiIvPgo8L2c+Cjwvc3ZnPg==)\n\n![Version](https://img.shields.io/npm/v/github-api-helper)\n[![codecov](https://codecov.io/gh/juunini/github-api-helper-ts/branch/main/graph/badge.svg?token=ZZE5D2GG05)](https://codecov.io/gh/juunini/github-api-helper-ts)\n[![ESLint](https://github.com/juunini/github-api-helper-ts/actions/workflows/eslint.yaml/badge.svg)](https://github.com/juunini/github-api-helper-ts/actions/workflows/eslint.yaml)\n\n\u003c/div\u003e\n\n## Install\n\n```bash\n# npm\nnpm install github-api-helper\n\n# yarn\nyarn add github-api-helper\n\n# pnpm\npnpm add github-api-helper\n\n# bun\nbun add github-api-helper\n```\n\n## Usage\n\n### OAuth\n\n```ts\nimport { OAuth, loginURL } from 'github-api-helper'\n\nconst oauth = new OAuth('client_id', 'client_secret')\n\nconst githubLoginURL = oauth.loginURL\n// or\n// const githubLoginURL = loginURL({ clientId: 'client_id' })\n\noauth.access_token('code').then((response) =\u003e console.log({\n  access_token: response.access_token,\n  refresh_token: response.refresh_token,\n}))\noauth.refresh_token('refresh_token').then((response) =\u003e console.log({\n  access_token: response.access_token,\n  refresh_token: response.refresh_token,\n}))\n```\n\n### Commit\n\n\u003e Access Token(or Personal access token) must have `Contents` Read and write permission of `Repository permissions`\n\n```ts\nimport { commit } from 'github-api-helper'\n\ncommit({\n  owner: 'juunini',\n  repo: 'test',\n  branch: 'main',\n  accessToken: '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',\n  files: [\n    {\n      path: 'README.md',\n      data: '# GitHub API Helper'\n    },\n    {\n      path: 'src/index.ts',\n      data: 'console.log(\\'Hello World\\')'\n    }\n  ],\n  committer: {\n    name: 'bot',\n    email: 'noreply@example.com'\n  },\n  message: 'commit message'\n})\n  .then(console.log)\n```\n\n### Read\n\n```ts\nimport { read } from 'github-api-helper'\n\nread({\n  owner: 'juunini',\n  repo: 'test',\n  branch: 'main', // optional\n  accessToken: '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',\n  path: 'README.md'\n}).then((response) =\u003e {\n  if (response instanceof Array) {\n    // directory\n  } else {\n    // file\n  }\n})\n```\n\n### User\n\n```ts\nimport { user } from 'github-api-helper'\n\nuser({ accessToken: 'accessToken' }).then(console.log)\n// or\nuser({ id: 41536271 }).then(console.log)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuunini%2Fgithub-api-helper-ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuunini%2Fgithub-api-helper-ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuunini%2Fgithub-api-helper-ts/lists"}