{"id":21304977,"url":"https://github.com/maximilianmairinger/ajaon","last_synced_at":"2026-05-20T09:10:50.179Z","repository":{"id":57175087,"uuid":"238245508","full_name":"maximilianMairinger/ajaon","owner":"maximilianMairinger","description":"Asynchron js and json. A tiny, fetch based http client for the web.","archived":false,"fork":false,"pushed_at":"2020-05-15T12:49:19.000Z","size":59,"stargazers_count":0,"open_issues_count":13,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-22T08:42:46.152Z","etag":null,"topics":["async","client","fetch","http","json","tiny","web"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/ajaon","language":"TypeScript","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/maximilianMairinger.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}},"created_at":"2020-02-04T15:58:26.000Z","updated_at":"2020-05-15T12:49:21.000Z","dependencies_parsed_at":"2022-09-03T08:50:30.515Z","dependency_job_id":null,"html_url":"https://github.com/maximilianMairinger/ajaon","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximilianMairinger%2Fajaon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximilianMairinger%2Fajaon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximilianMairinger%2Fajaon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximilianMairinger%2Fajaon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maximilianMairinger","download_url":"https://codeload.github.com/maximilianMairinger/ajaon/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243779639,"owners_count":20346750,"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":["async","client","fetch","http","json","tiny","web"],"created_at":"2024-11-21T16:16:31.857Z","updated_at":"2026-05-20T09:10:50.133Z","avatar_url":"https://github.com/maximilianMairinger.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ajaon\n\nAsynchron js and json (ajaon). A tiny, fetch based http client for the web.\n\n\n\n## Example\n\n### Quick start\n\n```js\nimport ajaon from \"ajaon\"\n\n// initialisation\nlet ajax = ajaon();\n\nlet req = ajax.post(\"apiCall\", {ok: \"ok\"})\nlet getReq = ajax.get(\"resource\")\n\nreq.then(console.log)\n```\n\n### Abort Network Requests\n\n```js\nsetTimeout(() =\u003e {\n  req.abort(\"Message\")\n}, 500)\n\nreq.fail(console.error) // Abort: Message\n```\n\nAbort, or a for any other reason failed network request, does not throw an `Error`, rather it calls all explicitly attached fail callbacks.\n\nIn this case, the `req` Promise would never be resolved.\n\n### Initialisation options\n\nThe quick start example used no explicit initialisation options, however there are a couple of helpful customisations to be considered. \n\n```ts\nlet apiUrl: string = \"backend.myUrl.com\" // Default: the baseUrl the website is renderd on\ntype SessKeyKey = {sessKeyKeyForStorage: string, sessKeyKeyForApi: string}\nlet sessKeyKey: string | SessKeyKey = \"sess_key\" // Default: \"sessKey\"\nlet storage: object = {} // Default: localStorage\nlet verbose: boolean = false // Default: true\n\nlet ajax = ajaon(apiUrl, sessKeyKey, storage, verbose)\n```\n\n* **`apiUrl`**: Your backend might be located on a different [`baseUrl`](\"https://www.npmjs.com/package/get-base-url\") than your frontend. This could be injected in your build script for different environments (dev, uat, prod). Please note that when no protocol (`http` / `https`) is given, ajaon will try `https` on your *first* call; though if it fails ajaon will try `http` next (without closing the outwards facing `Promise`).  The working protocol will be stored.\n* **`sessKeyKey`**: TODO\n\n## Contribute\n\nAll feedback is appreciated. Create a pull request or write an issue.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaximilianmairinger%2Fajaon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaximilianmairinger%2Fajaon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaximilianmairinger%2Fajaon/lists"}