{"id":24455555,"url":"https://github.com/nixjs/axios-client","last_synced_at":"2025-10-01T17:31:02.819Z","repository":{"id":41564406,"uuid":"509750652","full_name":"nixjs/axios-client","owner":"nixjs","description":"A small wrapper for integrating Axios to Typescript","archived":false,"fork":false,"pushed_at":"2022-11-26T15:19:33.000Z","size":17,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-15T14:23:13.314Z","etag":null,"topics":["axio-client","axios","axios-react","axios-wrapper","get","http-client","javascript","post","typescript"],"latest_commit_sha":null,"homepage":"","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/nixjs.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":"2022-07-02T12:32:51.000Z","updated_at":"2024-01-01T22:10:22.000Z","dependencies_parsed_at":"2023-01-22T19:01:17.636Z","dependency_job_id":null,"html_url":"https://github.com/nixjs/axios-client","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/nixjs%2Faxios-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nixjs%2Faxios-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nixjs%2Faxios-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nixjs%2Faxios-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nixjs","download_url":"https://codeload.github.com/nixjs/axios-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234883275,"owners_count":18901366,"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":["axio-client","axios","axios-react","axios-wrapper","get","http-client","javascript","post","typescript"],"created_at":"2025-01-21T02:13:43.961Z","updated_at":"2025-10-01T17:30:57.514Z","avatar_url":"https://github.com/nixjs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @nixjs23n6/axios-client\n\nA small wrapper for integrating Axios to Typescript\n\n## Quick Setup\n\n### Install\n\nInstall these dependencies:\n\n`yarn add @nixjs23n6/axios-client`\n\n### Setup \u0026 Usage\n\n```javascript\nimport { HttpClient, Types } from '@nixjs23n6/axios-client'\n\nclass Client extends HttpClient {\n    /**\n    * The Singleton's constructor should always be private to prevent direct\n    * construction calls with the `new` operator.\n    */\n    private constructor(args: Types.HttpClientArgs) {\n        super(args)\n    }\n\n    /**\n    * The static method that controls the access to the singleton instance.\n    *\n    * This implementation let you subclass the Singleton class while keeping\n    * just one instance of each subclass around.\n    */\n    public static get instance(): HttpClient {\n        if (HttpClient._instance) {\n            return this._instance\n        }\n        this._instance = new HttpClient({\n            baseURL: \"https://api.example.nixjs\"\n        })\n        if (this._instance \u0026\u0026 this._instance.client) {\n            // Config interceptors\n            this._instance.client.interceptors.request.use(\n                (config) =\u003e config,\n                (error) =\u003e {\n                    return Promise.resolve(error)\n                }\n            )\n            this._instance.client.interceptors.response.use(\n                (response) =\u003e {\n                    // Return a successful response back to the calling service\n                    return response\n                },\n                (error) =\u003e {\n                    const { response } = error\n\n                    return Promise.resolve(response)\n                }\n            )\n        }\n        return this._instance\n    }\n\n}\n\n\nconst client = Client.instance;\n\nclient.fetch\u003cany\u003e('/login', 'POST', { username: \"nghinv\", password: 'Abc1@34' }).then(console.log)\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnixjs%2Faxios-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnixjs%2Faxios-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnixjs%2Faxios-client/lists"}