# @imchhh/zod-class

> [![](https://badgen.net/bundlephobia/minzip/@imchhh/zod-class)](https://bundlephobia.com/result?p=@imchhh/zod-class) ![](https://badgen.net/npm/types/@imchhh/zod-class)

Latest version **0.0.7** (published 2023-05-23) · 0 weekly downloads

## Install

```sh
npm install @imchhh/zod-class
pnpm add @imchhh/zod-class
yarn add @imchhh/zod-class
bun add @imchhh/zod-class
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.7 |
| Published | 2023-05-23 |
| First published | 2023-05-19 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | imch |

## Links

- npm: https://www.npmjs.com/package/@imchhh/zod-class
- npm.io page: https://npm.io/package/@imchhh/zod-class

## Recent versions

- 0.0.7 (latest) — 2023-05-23
- 0.0.6 — 2023-05-23
- 0.0.5 — 2023-05-23
- 0.0.4 — 2023-05-22
- 0.0.3 — 2023-05-19
- 0.0.2 — 2023-05-19
- 0.0.1 — 2023-05-19

## README

# zod-class

[![](https://badgen.net/bundlephobia/minzip/@imchhh/zod-class)](https://bundlephobia.com/result?p=@imchhh/zod-class)
![](https://badgen.net/npm/types/@imchhh/zod-class)

## Acknowledgements

This library was heavily inspired by the [zod-class](https://github.com/sam-goodwin/zod-class) which made by **[@sam-goodwin](https://github.com/sam-goodwin)**. I took his implementation and just rewrote it into the code I needed for my purposes.

## Installation

```bash
pnpm add @imchhh/zod-class
```

## Example

```ts
import { ZodClass } from '@imchhh/zod-class';
import { z } from 'zod';

declare const unknownInput: unknown;

class User extends ZodClass({
  name: z.string(),
  age: z.number(),
}) {}

const user = User.parse(unknownInput);
```

## License

MIT

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