{"id":14969155,"url":"https://github.com/mcollina/manifetch","last_synced_at":"2025-08-22T23:10:43.275Z","repository":{"id":46773659,"uuid":"360975625","full_name":"mcollina/manifetch","owner":"mcollina","description":"A manifest-based fetch() API client builder.","archived":false,"fork":false,"pushed_at":"2023-09-10T08:08:21.000Z","size":698,"stargazers_count":38,"open_issues_count":5,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-06-13T07:44:33.714Z","etag":null,"topics":["api","fetch"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mcollina.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"open_collective":"fastify"}},"created_at":"2021-04-23T18:38:52.000Z","updated_at":"2025-01-10T21:51:45.000Z","dependencies_parsed_at":"2024-01-23T20:11:33.519Z","dependency_job_id":"987ec000-2950-4569-89ab-9365d6a8a86d","html_url":"https://github.com/mcollina/manifetch","commit_stats":null,"previous_names":["terixjs/manifetch"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mcollina/manifetch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcollina%2Fmanifetch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcollina%2Fmanifetch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcollina%2Fmanifetch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcollina%2Fmanifetch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mcollina","download_url":"https://codeload.github.com/mcollina/manifetch/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcollina%2Fmanifetch/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260552729,"owners_count":23026890,"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","fetch"],"created_at":"2024-09-24T13:41:14.531Z","updated_at":"2025-06-28T17:37:20.111Z","avatar_url":"https://github.com/mcollina.png","language":"JavaScript","funding_links":["https://opencollective.com/fastify"],"categories":[],"sub_categories":[],"readme":"# manifetch\n\nA simple manifest-based [`fetch()`](https://fetch.spec.whatwg.org/) API client building utility.\n\nIt is obvious in the sense it uses a staightforward, _**nearly obvious**_ pattern to **automatically build API clients from route definitions in a minimalist manifest**. Conceived originally as part of [`fastify-api`](https://github.com/galvez/fastify-api), which already provides a manifest compatible with `manifetch` based on your API route definitions.\n\n## Install\n\n```\n$ npm i manifetch --save\n```\n\n## Usage\n\n```js\nconst fetch = require('undici-fetch')\nconst manifetch = require('manifetch')\n\nconst prefix = 'https://jsonplaceholder.typicode.com'\nconst get = manifetch({ fetch, prefix })\n\nconst manifest = {\n  getPosts: ['GET', '/posts'],\n  getPost: ['GET', '/posts/:id'],\n  nestedDemonstration: {\n    getPosts: ['GET', '/posts'],\n    getPost: ['GET', '/posts/:id'],  \n  },\n}\n\nconst client = new Proxy(manifest, { get })\n\nasync function main () {\n  const { json: posts } = await client.getPosts()\n  const { json: post } = await client.getPost({ id: 10 })\n  console.log('First post out of collection:', posts[0])\n  console.log('Tenth post, individually requested', post)\n}\n\nmain().then(() =\u003e process.exit())\n```\n\nSee also [example][example] and [test][test].\n\n[example]: https://github.com/terixjs/manifetch/blob/main/example.js\n[test]: https://github.com/terixjs/manifetch/blob/main/test.js\n\n## Goals\n\n- [ ] **Work seamlessly** on **Node**, **Deno** and **on the browser**\n- [x] Facilitate `fetch()` usage with **minor**, **sensible API enhancements**\n- [x] **Automatically** construct API clients based on a **minimalist API manifest**\n- [ ] Support both a **minimalist manifest** and the **OpenAPI specification** \n\n## Status\n\n- [x] Basic Node implementation using [undici-fetch][uf] for `fetch()`\n- [ ] Write comprehensive test suite based on [node-tap](https://node-tap.org/).\n- [ ] Write comprehensive usage examples for [`fastify-api`][fa] and [`fastify-vite`][fv]\n- [ ] Optimize `applyParams()` implementation with new **fast-apply-params** package\n- [ ] Memoize `Proxy` instances on the client, prepopulate all wrappers on the server\n\n[fa]: https://github.com/galvez/fastify-api\n[fv]: https://github.com/galvez/fastify-vite\n[uf]: https://github.com/Ethan-Arrowood/undici-fetch\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcollina%2Fmanifetch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmcollina%2Fmanifetch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcollina%2Fmanifetch/lists"}