# @js-from-routes/axios

> Make API requests to a Rails apps with ease.

Latest version **1.0.5** (published 2025-03-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install @js-from-routes/axios
pnpm add @js-from-routes/axios
yarn add @js-from-routes/axios
bun add @js-from-routes/axios
```

## Health

**Score 50/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2025-03-27 |
| First published | 2021-03-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 127 |
| Author | Máximo Mussini |
| Maintainers | elmassimo |

## Links

- npm: https://www.npmjs.com/package/@js-from-routes/axios
- Repository: https://github.com/ElMassimo/js_from_routes
- Issues: https://github.com/ElMassimo/js_from_routes/issues
- npm.io page: https://npm.io/package/@js-from-routes/axios

## Recent versions

- 1.0.5 (latest) — 2025-03-27
- 1.0.4 — 2021-03-16
- 1.0.3 — 2021-03-13
- 1.0.2 — 2021-03-13
- 1.0.1 — 2021-03-13
- 1.0.0 — 2021-03-13

## README

<h2 align='center'><samp>@js-from-routes/axios</samp></h2>

<p align='center'>Define path helpers to make API requests or interpolate URLs</p>

<p align='center'>
  <a href='https://www.npmjs.com/package/@js-from-routes/axios'>
    <img src='https://img.shields.io/npm/v/@js-from-routes/axios?color=222&style=flat-square'>
  </a>
  <a href='https://github.com/ElMassimo/js_from_routes/blob/main/LICENSE.txt'>
    <img src='https://img.shields.io/badge/license-MIT-blue.svg'>
  </a>
</p>

<br>

[client]: https://github.com/ElMassimo/js_from_routes/tree/main/packages/client
[js_from_routes]: https://github.com/ElMassimo/js_from_routes
[axios]: https://github.com/axios/axios

This package extends <kbd>[@js-from-routes/client][client]</kbd> to use [Axios].

It's useful when already using [axios], or when you have a complex API that requires [interceptors](https://github.com/axios/axios#interceptors) or [different instances](https://github.com/axios/axios#creating-an-instance).

## Installation 💿

```bash
npm i @js-from-routes/axios # yarn add @js-from-routes/axios
```

## Usage 🚀

```ts
import { formatUrl, request } from '@js-from-routes/axios'

formatUrl('/video_clips/:id/download', { id: 5 }) == '/video_clips/5/download'

const video = await request('get', '/video_clips/:id', { id: 5 })
```

## License

This library is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).

---
_Source: https://npm.io/package/@js-from-routes/axios · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
