{"id":15984753,"url":"https://github.com/jaredreisinger/wordpressed","last_synced_at":"2025-03-17T15:32:18.907Z","repository":{"id":181747413,"uuid":"667239579","full_name":"JaredReisinger/wordpressed","owner":"JaredReisinger","description":"A modern, Typescript+ESM client for the WordPress REST API.","archived":false,"fork":false,"pushed_at":"2024-09-16T23:18:11.000Z","size":2071,"stargazers_count":1,"open_issues_count":14,"forks_count":0,"subscribers_count":2,"default_branch":"alpha","last_synced_at":"2024-10-15T02:34:58.169Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JaredReisinger.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":"docs/ROADMAP.md","authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-17T04:07:47.000Z","updated_at":"2023-10-05T07:22:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"bd02a119-d75a-4841-8644-d9a303ecf25a","html_url":"https://github.com/JaredReisinger/wordpressed","commit_stats":null,"previous_names":["jaredreisinger/wordpressed"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JaredReisinger%2Fwordpressed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JaredReisinger%2Fwordpressed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JaredReisinger%2Fwordpressed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JaredReisinger%2Fwordpressed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JaredReisinger","download_url":"https://codeload.github.com/JaredReisinger/wordpressed/tar.gz/refs/heads/alpha","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221696166,"owners_count":16865369,"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-08T02:10:22.430Z","updated_at":"2024-10-27T15:14:11.455Z","avatar_url":"https://github.com/JaredReisinger.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# wordpressed\n\nA modern, Typescript+ESM client for the WordPress REST API. _(Rhymes with “wordpREST”!)_\n\n[![npm version](https://img.shields.io/npm/v/wordpressed.svg?logo=npm)](https://www.npmjs.com/package/wordpressed)\n[![build status](https://img.shields.io/github/actions/workflow/status/JaredReisinger/wordpressed/build.yml?branch=alpha\u0026logo=github)](https://github.com/JaredReisinger/wordpressed/actions?query=workflow%3Abuild+branch%3Aalpha)\n[![code coverage](https://codecov.io/github/JaredReisinger/wordpressed/branch/alpha/graph/badge.svg?token=E3A3UAPD25)](https://codecov.io/github/JaredReisinger/wordpressed)\n[![known vulnerabilities](https://snyk.io/test/github/JaredReisinger/wordpressed/alpha/badge.svg)](https://snyk.io/test/github/JaredReisinger/wordpressed/alpha)\n\n\u003e **WARNING:** This is _**very much**_ an early work-in-progress. It is being published so that early feedback on design decisions can be made. There _**will**_ be changes to the way that calls/requests are made.\n\n## Usage\n\nJust construct the client with the URL to your WordPress host, and start making REST API calls with the `get()`, `post()`, `delete()`, etc. method-specific functions:\n\n```ts\nimport { Client } from 'wordpressed';\n\nconst client = new Client('http://myhost.example.org');\n\nconst response = await client.get('/wp/v2/pages', {\n  after: '2023-08-01T00:00:00Z',\n  per_page: 100,\n});\n\nresponse.body.forEach((page =\u003e { ... })\n```\n\nNote that you get Typescript type checking and intellisense completion (if your editor supports it) on the routes, the arguments specific to that route, and for the response body:\n\n![example usage](https://github.com/JaredReisinger/wordpressed/blob/alpha/docs/wordpressed-example.png?raw=true)\n\n## What to do if your routes aren’t included\n\nIf you have a use-case that involves a plugin/namespace/routes/endpoints that aren’t already a part of this library, you can use the included [`wordpressed` CLI](https://github.com/JaredReisinger/wordpressed/blob/alpha/docs/cli/README.md) to generate your own custom types, and then provide those to your client instance.\n\nSee the [_Customizing_ section of the type-generation docs](https://github.com/JaredReisinger/wordpressed/blob/alpha/docs/type-generation.md#customizing) for all the details.\n\n## It’s _much_ smaller than it looks!\n\nAs of 2023–08–09, `npm pack --dry-run` on my machine reports about 850kB in file size, which matches the “unpacked size” reported on npmjs.com. But 775kB (_**91%!**_) of that is the `namespace` directory, which is entirely Typescript types that only exist at edit/build time. If you are including this library and running any kind of bundler/transpiler, you will likely end up with _at most_ 32kB (3.8% of the package) of `.js` files included from this library in your final build.\n\nSo yes, it’s a relatively sizeable package for the runtime functionality. But the whole point of this is that 91% set of types that drastically improves the edit-time experience. As time goes on and more types come in, that proportion is likely to grow… but the actual run-time impact of the package will remain unchanged.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaredreisinger%2Fwordpressed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaredreisinger%2Fwordpressed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaredreisinger%2Fwordpressed/lists"}