{"id":19013350,"url":"https://github.com/z41z/foraxios","last_synced_at":"2026-06-13T21:31:49.526Z","repository":{"id":182928504,"uuid":"669365765","full_name":"z41z/foraxios","owner":"z41z","description":"Easy axios to use.","archived":false,"fork":false,"pushed_at":"2023-07-22T06:03:42.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-10T21:36:44.262Z","etag":null,"topics":["axios","easy-axios","foraxios"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/z41z.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2023-07-22T03:59:24.000Z","updated_at":"2023-07-22T05:38:25.000Z","dependencies_parsed_at":"2023-07-22T05:46:30.963Z","dependency_job_id":null,"html_url":"https://github.com/z41z/foraxios","commit_stats":null,"previous_names":["z41z/foraxios"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/z41z/foraxios","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/z41z%2Fforaxios","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/z41z%2Fforaxios/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/z41z%2Fforaxios/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/z41z%2Fforaxios/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/z41z","download_url":"https://codeload.github.com/z41z/foraxios/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/z41z%2Fforaxios/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34301730,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-13T02:00:06.617Z","response_time":62,"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":["axios","easy-axios","foraxios"],"created_at":"2024-11-08T19:23:35.230Z","updated_at":"2026-06-13T21:31:49.507Z","avatar_url":"https://github.com/z41z.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# foraxios\nEasy Axios to use.\n## Install\n\n``` node\n  npm i foraxios //or yarn add foraxios\n```\n\n### Usage\n\n``` js\nimport ForAxios from 'foraxios';\n// Message is unnecessary\nimport { Message } from 'element-ui';\nconst foraxios = new ForAxios({\n  // Request handler\n  request(config) {\n    // config content is api request content.\n    if (config.isOpenApi === undefined) {\n      config.headers = {\n        'token': `Bearer ${localStorage.access_token}`\n      }\n    }\n  },\n  // Request success handler\n  success(res) {\n    // res is api data returned\n    if (res.code !== 0) {\n      Message.error(res.msg)\n    }\n    return {\n      ...res,\n      isSuccess: true\n    }\n  },\n  // Request error handler\n  error(err) {\n    Message.error(err)\n    return err\n  }\n})\n\n// Common request\nconst login = (data) =\u003e {\n  return foraxios.$api(\n    {\n      url: `/api/login`,\n      method: 'post',\n      data,\n      name: '用户登录'\n    }\n  )\n}\n// Donwload binary file\nconst exportFile = (data) =\u003e {\n  return foraxios.$api(\n    {\n      url: `/api/export`,\n      data: {\n        ...data,\n        fileName: 'export.xlsx'\n      },\n      name: 'export file',\n      type: 'file'\n    }\n  )\n}\n```\n\n\n### Base Config `Object`\n  - {Function} request = (config) =\u003e { } :`Request handler.`\n  - {Function} success = (res) =\u003e { } :`Request success handler.`\n  - {Function} error = (err) =\u003e { } :`Request error handler.`\n  - {Number} timeout = 10e3 :`Request timeout.`\n  - {Object} headers  :`Request.`\n  - {Boolean} isShowConsole = true :`Is show message on console.`\n\n### Request API Config `Object`\n  - {String} url  :`Request url.`\n  - {*} data  :`Request data.`\n  - {String} name  :`API name.`\n  - {String} method = 'get' :`Request method.`\n  - {String} type  :`Set value 'file' then download binary file.`\n  - {*} mockData  :`Mock Data`","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fz41z%2Fforaxios","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fz41z%2Fforaxios","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fz41z%2Fforaxios/lists"}