{"id":15685064,"url":"https://github.com/erfanium/page_iter","last_synced_at":"2025-08-03T15:38:11.005Z","repository":{"id":62422241,"uuid":"392706620","full_name":"erfanium/page_iter","owner":"erfanium","description":"Iterate through paginated api results for Deno","archived":false,"fork":false,"pushed_at":"2021-08-04T14:40:08.000Z","size":2,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-05T12:46:14.681Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://deno.land/x/page_iter@v1.0.0","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/erfanium.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}},"created_at":"2021-08-04T13:51:57.000Z","updated_at":"2021-08-04T14:52:54.000Z","dependencies_parsed_at":"2022-11-01T17:33:16.119Z","dependency_job_id":null,"html_url":"https://github.com/erfanium/page_iter","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erfanium%2Fpage_iter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erfanium%2Fpage_iter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erfanium%2Fpage_iter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erfanium%2Fpage_iter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/erfanium","download_url":"https://codeload.github.com/erfanium/page_iter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246308051,"owners_count":20756482,"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":[],"created_at":"2024-10-03T17:23:13.769Z","updated_at":"2025-03-30T11:11:47.249Z","avatar_url":"https://github.com/erfanium.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# page_iter\n\nIterate through paginated api results\n\n## Example\n\n```ts\ninterface Todo {\n  id: number;\n  title: string;\n}\n\nconst fetchTodos: PagedHandler\u003cTodo\u003e = async (page: number) =\u003e {\n  const response = await fetch(\n    `https://jsonplaceholder.typicode.com/todos?_start=${(page - 1) *\n      10}\u0026_limit=10`,\n  );\n\n  const body: Todo[] = await response.json();\n\n  if (body.length === 0) {\n    return {\n      data: [],\n      nextPage: null,\n    };\n  }\n\n  return {\n    data: body,\n    nextPage: page + 1,\n  };\n};\n\nfor await (const todo of pageIter(fetchTodos)) {\n  console.log(todo.id, todo.title);\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferfanium%2Fpage_iter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferfanium%2Fpage_iter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferfanium%2Fpage_iter/lists"}