{"id":22489793,"url":"https://github.com/art-emini/AxleJS","last_synced_at":"2025-08-02T22:31:17.548Z","repository":{"id":37186355,"uuid":"400881771","full_name":"art-emini/AxleJS","owner":"art-emini","description":"Fetch, supercharged.","archived":false,"fork":false,"pushed_at":"2023-01-16T01:09:59.000Z","size":316,"stargazers_count":28,"open_issues_count":9,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-24T09:51:37.252Z","etag":null,"topics":["api","axle","client","client-side","fetch","http","http-methods","js","request","rest-api","supercharged","ts"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/art-emini.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null}},"created_at":"2021-08-28T20:12:24.000Z","updated_at":"2022-01-25T02:34:56.000Z","dependencies_parsed_at":"2023-02-10T00:15:49.404Z","dependency_job_id":null,"html_url":"https://github.com/art-emini/AxleJS","commit_stats":null,"previous_names":["ksplatdev/axlejs"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/art-emini%2FAxleJS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/art-emini%2FAxleJS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/art-emini%2FAxleJS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/art-emini%2FAxleJS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/art-emini","download_url":"https://codeload.github.com/art-emini/AxleJS/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228500483,"owners_count":17930076,"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":["api","axle","client","client-side","fetch","http","http-methods","js","request","rest-api","supercharged","ts"],"created_at":"2024-12-06T17:20:45.271Z","updated_at":"2024-12-06T17:23:09.262Z","avatar_url":"https://github.com/art-emini.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# AxleJS\n\n![MIT LICENSE](https://img.shields.io/github/license/ksplatdev/AxleJS)\n![GitHub release (latest by date)](https://img.shields.io/github/v/release/ksplatdev/AxleJS)\n![GitHub last commit](https://img.shields.io/github/last-commit/ksplatdev/AxleJS)\n![GitHub Workflow Status](https://img.shields.io/github/workflow/status/ksplatdev/AxleJS/CodeQL)\n![NPM Downloads](https://img.shields.io/npm/dm/axlejs?label=npm%20downloads)\n![jsDelivr hits (npm)](https://img.shields.io/jsdelivr/npm/hm/axlejs)\n![Active Development](https://img.shields.io/badge/Maintenance%20Level-Actively%20Developed-brightgreen.svg)\n\nFetch, supercharged.\n\n## About\n\nThe [Fetch Web API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch) is great, but it could be better.\n\nAxleJS supercharges fetch, with better error handling, easier to use options, can automatically follow redirects, an easier way to manage and view headers and search queries, custom response and request classes and methods, and a lot more.\n\n## [Documentation](https://github.com/ksplatdev/AxleJS/wiki/Documenation)\n\n## Features\n\n1. Functions for all HTTP Restful Methods.\n2. Use built-in middleware or make custom middleware.\n3. Very small, ~10KB Minified and ~17KB Unminified.\n4. Fast and easy to use.\n5. [Documentation](https://github.com/ksplatdev/AxleJS/wiki/Documenation).\n6. Makes fetch easier to use.\n7. Better Error handling.\n8. Adds cancellation to fetch api.\n9. Custom and Extended Response and Request classes.\n10. Written in TypeScript.\n11. Built-in TypeDefs.\n\n## How to Download\n\n### GitHub\n\n1. Download the [latest release](https://github.com/ksplatdev/AxleJS/releases/latest) from GitHub.\n2. Unzip and move contents into your project.\n3. Import AxleJS with the [ES6 Import Syntax](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import).\n4. Read the [documentation](https://github.com/ksplatdev/AxleJS/wiki/Documenation).\n\n### NPM\n\n1. Run `npm i axlejs`.\n2. Import AxleJS with the [ES6 Import Syntax](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import).\n3. Read the [documentation](https://github.com/ksplatdev/AxleJS/wiki/Documenation).\n\n### CDN\n\n1. Import from \u003chttps://cdn.jsdelivr.net/npm/axlejs@1.1.1/dist/index.js\u003e or for minified version \u003chttps://cdn.jsdelivr.net/npm/axlejs@1.1.1/dist/index.min.js\u003e.\n2. Read the [documentation](https://github.com/ksplatdev/AxleJS/wiki/Documenation).\n\n## Quick Start\n\nIn order to use AxleJS, you will need to download it first. [Choose a way to download it.](#how-to-download) \\\nAfter you have downloaded it import AxleJS into your project.\n\n```js\n// NPM\nimport Axle from 'axlejs';\n\n// GitHub\nimport Axle from 'pathToAxle/index.js';\n\n// CDN\nimport Axle from 'cdnLinkHere';\n\n// ------------\n\n// For minified versions\n\n// NPM\nimport Axle from 'axlejs/dist/index.min.js';\n\n// GitHub\nimport Axle from 'pathToAxle/index.min.js';\n\n// CDN\nimport Axle from 'minifiedCdnLinkHere';\n\n\n```\n\nTo access AxleTypes for typescript, import like the following.\n\n```js\nimport Axle, { AxleTypes } from 'pathToAxle';\n\n```\n\nMaking a request.\n\nTo make a request, you call Axle.\\\u003cmethod\\\u003e().\n\n```js\nimport Axle from 'pathToAxle';\n\n// post\nAxle.post('https://someApi.com/api/test',\n    // Data to post to server\n    {\n        someDataHere: 'AxleJS'\n    },\n    // AxleOptions which is fetch api options but extended and slightly modified (check docs), this is optional and the default value for Axle.post\n    {\n        mode: 'cors',\n        cache: 'default',\n        credentials: 'same-origin',\n        headers: {\n            'Content-Type': 'application/json',\n        },\n    }\n);\n\n// get\nAxle.get('https://someApi.com/home', \n    // AxleOptions which is fetch api options but extended and slightly modified (check docs), this is optional and the default value for Axle.get\n    {\n        mode: 'cors',\n        cache: 'default',\n    }\n)\n\n// Any other http restful methods are available. Check https://www.restapitutorial.com/lessons/httpmethods.html for all HTTP Methods for Restful services\n\n```\n\nCancelling a request is just as easy with AxleJS.\n\n```js\nimport Axle from 'pathToAxle';\n\nconst cancelMark = new Axle.cancelMark();\nconst cancelSignal = cancelMark.signal;\n\nAxle.post('https://someApi.com/api/test',\n    // Data to post to server\n    {\n        someDataHere: 'AxleJS'\n    },\n    // AxleOptions which is fetch api options but extended and slightly modified (check docs), this is optional and the default value for Axle.post\n    {\n        mode: 'cors',\n        cache: 'default',\n        credentials: 'same-origin',\n        headers: {\n            'Content-Type': 'application/json',\n        },\n        // insert cancelSignal here\n        // this is native to the fetch api by using an AbortController and an AbortSignal\n        signal: cancelSignal\n    }\n);\n\n// Cancel request with an optional error message\ncancelMark.cancel('Canceled AxleRequest.');\n\n```\n\nFor more info, read the documentation.\n\n## Contributor's Guide\n\n### Requirements\n\n1. Must know TypeScript, Git, NPM, and how the Fetch API works and how to use it.\n2. Must read and agree to the [Code of Conduct](CODE_OF_CONDUCT.md) and [Contributing Guidelines](CONTRIBUTING.md).\n\n### How to Contribute\n\n1. Fork the repository on GitHub.\n2. Create a new branch on GitHub named after what you are doing, such as a bugfix, feature, or patch. EX: patch-update-readme\n3. Clone your forked repository to your local machine.\n4. CD into your cloned repository and run `npm install` to install all the devDependencies.\n5. Run `npm build` or press CTRL + SHIFT + B on vscode to compile, bundles, and minify the files.\n6. Create a new local branch with the same name as your new remote branch.\n7. Make your changes.\n8. Build your changes with `npm build` or press CTRL + SHIFT + B on vscode.\n9. Test your changes on codesandbox or any other platform.\n10. Stage, Commit, and Push your changes on your branch.\n11. Create a pull request to merge onto the staging branch.\n12. State all changes as a changelog in the pull request.\n13. Wait for your pull request to be reviewed and possibly merged.\n14. Thanks for contributing!\n\n### File Structure\n\n1. Src directory - All the source code is in here\n2. Lib directory - TypeScript files are compiled into JavaScript into here.\n3. Dist directory - The Bundled and Minified files are here as well as the TypeScript declaration files. This is the final build.\n4. Scripts directory - Shell scripts such as the build script which compiles, bundles, and minifies the files is located here.\n\n### Developer Scripts\n\n1. `npm run test` - Opens the test codesandbox in your default browser.\n2. `npm run build` - Compiles, Bundles, and Minifies the file to create the final product in the dist directory.\n3. `npm run bundle` - Bundles everything in the lib directory with webpack and outputs to dist.\n4. `npm run format` - Uses prettier to format all files in the src directory.\n5. `npm run format:watch` - Listens for changes on files and formats those files on change.\n6. `npm run lint` - Uses eslint to lint all files in the src directory.\n7. `npm run lint:watch` - Listens for changes on files and lints those files on change.\n8. `npm run lint:fix` - Uses eslint to lint and fix all files in the src directory.\n9. `npm run minify` - Uses uglifyjs to minify the bundled file in the dist directory and outputs in the dist directory.\n\n## License\n\n[MIT LICENSE](LICENSE)\n\n## Author\n\nBleart Emini - ksplatdev\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fart-emini%2FAxleJS","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fart-emini%2FAxleJS","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fart-emini%2FAxleJS/lists"}