{"id":19972581,"url":"https://github.com/jpb06/effect-github-stats","last_synced_at":"2025-05-04T01:30:51.728Z","repository":{"id":221554942,"uuid":"754708302","full_name":"jpb06/effect-github-stats","owner":"jpb06","description":"An effect layer to interact with github api","archived":true,"fork":false,"pushed_at":"2025-02-23T20:03:09.000Z","size":516,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-05T17:47:11.360Z","etag":null,"topics":["effect-layer","effect-ts","github-stats","octokit"],"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/jpb06.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2024-02-08T16:08:58.000Z","updated_at":"2025-02-23T20:03:38.000Z","dependencies_parsed_at":"2024-03-15T21:46:10.470Z","dependency_job_id":"7d1c73b0-a6b5-40ea-8940-c5405ae31629","html_url":"https://github.com/jpb06/effect-github-stats","commit_stats":null,"previous_names":["jpb06/github-stats","jpb06/effect-github-stats"],"tags_count":35,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpb06%2Feffect-github-stats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpb06%2Feffect-github-stats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpb06%2Feffect-github-stats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpb06%2Feffect-github-stats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jpb06","download_url":"https://codeload.github.com/jpb06/effect-github-stats/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252276955,"owners_count":21722447,"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":["effect-layer","effect-ts","github-stats","octokit"],"created_at":"2024-11-13T03:08:36.768Z","updated_at":"2025-05-04T01:30:51.712Z","avatar_url":"https://github.com/jpb06.png","language":"TypeScript","readme":"# effect-github-stats\n\n[![Open in Visual Studio Code](https://img.shields.io/static/v1?logo=visualstudiocode\u0026label=\u0026message=Open%20in%20Visual%20Studio%20Code\u0026labelColor=2c2c32\u0026color=007acc\u0026logoColor=007acc)](https://github.dev/jpb06/effect-github-stats)\n![npm bundle size](https://img.shields.io/bundlephobia/min/effect-github-stats)\n![Github workflow](https://img.shields.io/github/actions/workflow/status/jpb06/effect-github-stats/ci.yml?branch=main\u0026logo=github-actions\u0026label=last%20workflow)\n![Last commit](https://img.shields.io/github/last-commit/jpb06/effect-github-stats?logo=git)\n\nAn [Effect](https://effect.website/) layer to interact with github api.\n\n# 😺 This codebase has moved to [effect-octokit-layer](https://github.com/jpb06/effect-octokit-layer)\n\n\u003c!-- readme-package-icons start --\u003e\n\n\u003cp align=\"left\"\u003e\u003ca href=\"https://docs.github.com/en/actions\" target=\"_blank\"\u003e\u003cimg height=\"50\" src=\"https://raw.githubusercontent.com/jpb06/jpb06/master/icons/GithubActions-Dark.svg\" /\u003e\u003c/a\u003e\u0026nbsp;\u003ca href=\"https://www.typescriptlang.org/docs/\" target=\"_blank\"\u003e\u003cimg height=\"50\" src=\"https://raw.githubusercontent.com/jpb06/jpb06/master/icons/TypeScript.svg\" /\u003e\u003c/a\u003e\u0026nbsp;\u003ca href=\"https://nodejs.org/en/docs/\" target=\"_blank\"\u003e\u003cimg height=\"50\" src=\"https://raw.githubusercontent.com/jpb06/jpb06/master/icons/NodeJS-Dark.svg\" /\u003e\u003c/a\u003e\u0026nbsp;\u003ca href=\"https://bun.sh/docs\" target=\"_blank\"\u003e\u003cimg height=\"50\" src=\"https://raw.githubusercontent.com/jpb06/jpb06/master/icons/Bun-Dark.svg\" /\u003e\u003c/a\u003e\u0026nbsp;\u003ca href=\"https://biomejs.dev/guides/getting-started/\" target=\"_blank\"\u003e\u003cimg height=\"50\" src=\"https://raw.githubusercontent.com/jpb06/jpb06/master/icons/Biome-Dark.svg\" /\u003e\u003c/a\u003e\u0026nbsp;\u003ca href=\"https://github.com/motdotla/dotenv#readme\" target=\"_blank\"\u003e\u003cimg height=\"50\" src=\"https://raw.githubusercontent.com/jpb06/jpb06/master/icons/Dotenv-Dark.svg\" /\u003e\u003c/a\u003e\u0026nbsp;\u003ca href=\"https://vitest.dev/guide/\" target=\"_blank\"\u003e\u003cimg height=\"50\" src=\"https://raw.githubusercontent.com/jpb06/jpb06/master/icons/Vitest-Dark.svg\" /\u003e\u003c/a\u003e\u0026nbsp;\u003ca href=\"https://www.effect.website/docs/quickstart\" target=\"_blank\"\u003e\u003cimg height=\"50\" src=\"https://raw.githubusercontent.com/jpb06/jpb06/master/icons/Effect-Dark.svg\" /\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003c!-- readme-package-icons end --\u003e\n\n## ⚡ Access to github api\n\nYou first need to [create a github token](https://github.com/settings/tokens) with a scope related to your needs.\n\n```bash\nGITHUB_TOKEN=\"my-github-token\"\n```\n\n## ⚡ Layer Api\n\n### 🔶 Users\n\n```typescript\nimport { OctokitLayer, OctokitLayerLive } from 'effect-github-stats';\n\nconst username = 'jpb06';\n\nconst [profile, repos, orgs, events] = await Effect.runPromise(\n  pipe(\n    Effect.all(\n      [\n        // Get user profile\n        OctokitLayer.user(username).profile(),\n        // Get user repos\n        OctokitLayer.user(username).repos(),\n        // Get user organizations\n        OctokitLayer.user(username).orgs(),\n        // Get user events\n        OctokitLayer.user(username).events(),\n      ],\n      // Fetch all these in parallel\n      { concurrency: 'unbounded' }\n    ),\n    Effect.provide(OctokitLayerLive)\n  )\n);\n```\n\n### 🔶 Organizations\n\n```typescript\nimport { OctokitLayer, OctokitLayerLive } from 'effect-github-stats';\n\nconst orgs = await Effect.runPromise(\n  pipe(\n    // Get organization repos\n    OctokitLayer.org('my-org').repos(),\n    Effect.provide(OctokitLayerLive)\n  )\n);\n```\n\n### 🔶 Repositories\n\n```typescript\nimport { RepoArgs, OctokitLayer, OctokitLayerLive } from 'effect-github-stats';\n\nconst reactRepo: RepoArgs = {\n  owner: 'facebook',\n  name: 'react',\n};\n\nconst [issues, pulls, issue34, pull5453, pull5453Reviews] =\n  await Effect.runPromise(\n    pipe(\n      Effect.all(\n        [\n          // Get all issues\n          OctokitLayer.repo(reactRepo).issues(),\n          // Get all pull requests\n          OctokitLayer.repo(reactRepo).pulls(),\n          // Get issue #34\n          OctokitLayer.repo(reactRepo).issue(34),\n          // Get pull request #5453 data\n          OctokitLayer.repo(reactRepo).pull(5453).details(),\n          // Get pull request #5453 reviews\n          OctokitLayer.repo(reactRepo).pull(5453).reviews(),\n        ],\n        // Fetch all these in parallel\n        { concurrency: 'unbounded' }\n      ),\n      Effect.provide(OctokitLayerLive)\n    )\n  );\n```\n\n### 🔶 Parallelism and resilience\n\n#### 🧿 Concurrency\n\n\u003e Default: `10`\n\nYou can specify the `concurrency` parameter on calls doing several requests in parallel (paginated data). For example:\n\n```typescript\n// Will fetch the first page and then 100 pages concurrently\nOctokitLayer.repo({\n  owner: 'facebook',\n  name: 'react',\n}).pulls(100);\n```\n\nNote that github api enforces [api rate limits](https://docs.github.com/en/rest/using-the-rest-api/best-practices-for-using-the-rest-api?apiVersion=2022-11-28#dealing-with-secondary-rate-limits). Fetching too many results concurrently will cause an api rate limit. In that case, a warning will be displayed and the call will be attempted again after the time window provided by github api (typically 60 seconds).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpb06%2Feffect-github-stats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjpb06%2Feffect-github-stats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpb06%2Feffect-github-stats/lists"}