{"id":49298157,"url":"https://github.com/bigskysoftware/rexi","last_synced_at":"2026-05-02T07:01:04.220Z","repository":{"id":353833306,"uuid":"1220945812","full_name":"bigskysoftware/rexi","owner":"bigskysoftware","description":"rexi.js - a companion to fixi.js","archived":false,"fork":false,"pushed_at":"2026-04-25T18:54:28.000Z","size":10,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-05-01T06:04:07.784Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://fixiproject.org","language":"HTML","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/bigskysoftware.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,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-25T14:50:09.000Z","updated_at":"2026-04-28T02:21:16.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/bigskysoftware/rexi","commit_stats":null,"previous_names":["bigskysoftware/rexi"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bigskysoftware/rexi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigskysoftware%2Frexi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigskysoftware%2Frexi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigskysoftware%2Frexi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigskysoftware%2Frexi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bigskysoftware","download_url":"https://codeload.github.com/bigskysoftware/rexi/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigskysoftware%2Frexi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32525896,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-02T01:12:54.858Z","status":"online","status_checked_at":"2026-05-02T02:00:05.923Z","response_time":132,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2026-04-26T05:00:50.838Z","updated_at":"2026-05-02T07:01:04.173Z","avatar_url":"https://github.com/bigskysoftware.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1\u003e\u0026#x1F415; rexi.js - \u003ci\u003ea fluent little fetch...\u003c/i\u003e\u003c/h1\u003e\n\nrexi.js is an experimental, minimalist fetch wrapper with HTTP-verb shortcuts, form\nserialization, chainable body parsers, and throw-on-error semantics. It's the JSON-side\ncompanion for the [fixi.js](https://github.com/bigskysoftware/fixi) family: for the times\nyou do need to talk to an API from client code.\n\nPart of the [fixi project](https://fixiproject.org).\n\nHere is an example:\n\n```html\n\u003cscript src=\"rexi.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n    let me = await get(\"/api/me\").json()\n    await post(\"/api/login\", document.forms.login)          // form element\n    await post(\"/api/users\", {name: \"Ada\"})                 // JSON body\n    await get(\"/search\", {q: \"hi\"}, {include: \"#filters\"})  // query string + extra fields\n\u003c/script\u003e\n```\n\nSix verb helpers (`get`, `head`, `post`, `put`, `patch`, `del`) are attached to\n`globalThis` for zero-ceremony use. Each returns a decorated `Promise\u003cResponse\u003e` with\n`.json()`, `.text()`, `.blob()`, `.html()`, `.raw()`, and `.abort()` sugar so the common\ncase is one `await`.\n\n## Minimalism\n\nrexi is deliberately tiny: no interceptor pipeline, no retry logic, no automatic base\nURL, no upload progress, no caching layer, no built-in download helper. If your app\noutgrows it, reach for [ky](https://github.com/sindresorhus/ky) or\n[wretch](https://github.com/elbywan/wretch).\n\n## Installing\n\nDrop `rexi.js` into a script tag:\n\n```html\n\u003cscript src=\"rexi.js\"\u003e\u003c/script\u003e\n```\n\nOr install via npm:\n\n```\nnpm install rexi-js\n```\n\n## API\n\n### Verbs\n\nAll six verbs share the same shape:\n\n```\nget|head|post|put|patch|del(url, body?, opts?)\n```\n\n`del` is used instead of `delete` because bare `delete(x)` is a JavaScript syntax trap.\nBoth `rexi.del` and `window.del` are exposed.\n\n### Body normalization\n\nThe second positional arg is a logical \"input\". Its type decides the wire format:\n\n| Input                                     | Sent as                                            |\n|-------------------------------------------|----------------------------------------------------|\n| `FormData`                                | as-is                                              |\n| `HTMLFormElement`                         | `new FormData(el)`                                 |\n| single named input element                | `FormData` with one `[name, value]` entry          |\n| iterable of elements (e.g. moxi `q(...)`) | `FormData` collecting each element's `[name,value]`|\n| plain object                              | `JSON.stringify`, `Content-Type: application/json` |\n| `string` / `Blob` / `URLSearchParams` / `ArrayBuffer` | passed straight to fetch               |\n| `null` / `undefined`                      | no body                                            |\n\n### Method disposition\n\nBy default `GET` / `HEAD` / `DEL` URL-encode the body into the query string (with\nrepeating keys for array values), and `POST` / `PUT` / `PATCH` send it in the request\nbody. Override with `opts.send: \"query\" | \"body\"`.\n\n### Options\n\n```js\n{\n  include: selector | Element | iterable | Array\u003cany of those\u003e,  // merge extra form fields\n  send:    \"query\" | \"body\",                                     // override method default\n  timeout: ms,                                                   // abort after N ms\n  signal:  AbortSignal,                                          // external cancel, chains in\n  headers: {...},                                                // merged with auto Content-Type\n  ...                                                            // passed through to fetch()\n}\n```\n\n`include` with a JSON body promotes the request to form mode (the JSON object is\nflattened into FormData entries).\n\n### Response helpers\n\n```js\nlet p = get(url, body, opts)\nawait p.json()   // parsed JSON\nawait p.text()   // string\nawait p.blob()   // Blob\nawait p.html()   // DocumentFragment (parsed via \u003ctemplate\u003e)\nawait p.raw()    // the raw Response\np.abort()        // cancel the underlying fetch\n```\n\nNon-2xx responses throw an `Error` carrying `.status` and `.response` (the raw\nResponse, for bodies/headers).\n\n### Lifecycle events\n\nrexi dispatches two CustomEvents on `document`:\n\n* `rexi:before` - cancelable; `detail.cfg = {url, init}` can be mutated (e.g. to inject\n  an `Authorization` header). `preventDefault()` aborts the request with `AbortError`.\n* `rexi:after` - fires for every completed fetch (including non-2xx, before rexi\n  throws); `detail = {cfg, response}`.\n\n```js\ndocument.addEventListener(\"rexi:before\", (e) =\u003e {\n    e.detail.cfg.init.headers.Authorization = `Bearer ${token}`\n})\n```\n\n## LICENCE\n\n```\nZero-Clause BSD\n=============\n\nPermission to use, copy, modify, and/or distribute this software for\nany purpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL\nWARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES\nOF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE\nFOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY\nDAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN\nAN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT\nOF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbigskysoftware%2Frexi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbigskysoftware%2Frexi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbigskysoftware%2Frexi/lists"}