# axzod

> Axios with Zod-Powered validation

Latest version **1.1.3** (published 2023-07-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install axzod
pnpm add axzod
yarn add axzod
bun add axzod
```

## Health

**Score 25/100 (F)** — status: abandoned.

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

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.3 |
| Published | 2023-07-11 |
| First published | 2023-07-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 25.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | thiagokovnat |
| Keywords | axios, zod, axzod, http, promise, node, ajax |

## Links

- npm: https://www.npmjs.com/package/axzod
- Repository: https://github.com/thiagokovnat/Axzod
- Homepage: https://github.com/thiagokovnat/Axzod#readme
- Issues: https://github.com/thiagokovnat/Axzod/issues
- npm.io page: https://npm.io/package/axzod

## Dependencies (3)

- [zod](https://npm.io/package/zod.md) ^3.21.4
- [axios](https://npm.io/package/axios.md) ^1.4.0
- [zod-validation-error](https://npm.io/package/zod-validation-error.md) ^1.3.1

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 1.1.3 (latest) — 2023-07-11
- 1.1.2 — 2023-07-11
- 1.1.1 — 2023-07-11
- 1.1.0 — 2023-07-11
- 1.0.8 — 2023-07-10
- 1.0.7 — 2023-07-10
- 1.0.6 — 2023-07-10
- 1.0.5 — 2023-07-10
- 1.0.4 — 2023-07-10
- 1.0.3 — 2023-07-10
- 1.0.2 — 2023-07-10
- 1.0.1 — 2023-07-10
- 1.0.0 — 2023-07-10

## README

AXZOD

Axzod is powered by Axios and Zod. It provides a way of typing your request responses using the power of Zod.


Example

```
import {createAxzod} from 'axzod'
import {z} from 'zod'

const TodoSchema = z.object({
    userId: z.number(),
    id: z.number(),
    title: z.string(),
    completed: z.boolean()
})

const instance = createAxzod({logging: true, baseURL: "https://jsonplaceholder.typicode.com"})


// Todo is now typed using the schema provided.
instance.get("/todos/1", TodoSchema).then(todo => console.log(todo.userId))
```


API

```
async get<T>(url: string, schema: z.ZodType<T>, config?: AxzodRequestConfig): Promise<T>
async delete<T>(url: string, schema: z.ZodType<T>, config?: AxzodRequestConfig): Promise<T>
async post<T>(url: string, schema: z.ZodType<T>, body?: any, config?: AxzodRequestConfig): Promise<T>
async put<T>(url: string, schema: z.ZodType<T>, body?: any, config?: AxzodRequestConfig): Promise<T>
async request<T>(config: AxzodRequestConfig, schema: z.ZodType<T>): Promise<T>

instance: AxiosInstance // The underlying AxiosInstance that Axzod is using. You can access this instance to modify the Axios instance yourself. This way you can add interceptors to your requests and responses.
```

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