# is-zod

> Typeguard to check if a value matches a zod schema

Latest version **2.0.1** (published 2026-03-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install is-zod
pnpm add is-zod
yarn add is-zod
bun add is-zod
```

## Health

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

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

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2026-03-10 |
| First published | 2023-01-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | ^24.0.0 \|\| ^26.0.0 |
| Dependencies | 1 |
| Unpacked size | 5.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Connor White |
| Maintainers | bconnorwhite |
| Keywords | zod, type, typeguard, schema, is |

## Links

- npm: https://www.npmjs.com/package/is-zod
- Repository: https://github.com/bconnorwhite/is-zod
- Homepage: https://github.bconnorwhite.com/is-zod#readme
- Issues: https://github.com/bconnorwhite/is-zod/issues
- npm.io page: https://npm.io/package/is-zod

## Dependencies (1)

- [zod](https://npm.io/package/zod.md) ^3.20.2

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 2.0.1 (latest) — 2026-03-10
- 2.0.0 — 2026-03-10
- 1.0.0 — 2023-01-29

## README

<!--BEGIN HEADER-->
<div id="top" align="center">
  <h1>is-zod</h1>
  <a href="https://npmjs.com/package/is-zod">
    <img alt="NPM" src="https://img.shields.io/npm/v/is-zod.svg">
  </a>
  <a href="https://github.com/bconnorwhite/is-zod">
    <img alt="TypeScript" src="https://img.shields.io/github/languages/top/bconnorwhite/is-zod.svg">
  </a>
</div>

<br />

<blockquote align="center">Typeguard to check if a value matches a zod schema.</blockquote>

---
<!--END HEADER-->

<!-- BEGIN INSTALLATION -->
## Installation

<details open>
  <summary>
    <a href="https://www.npmjs.com/package/is-zod">
      <img src="https://img.shields.io/badge/npm-CB3837?logo=npm&logoColor=white" alt="NPM" />
    </a>
  </summary>

```sh
npm install is-zod
```

</details>

<details>
  <summary>
    <a href="https://yarnpkg.com/package/is-zod">
      <img src="https://img.shields.io/badge/yarn-2C8EBB?logo=yarn&logoColor=white" alt="Yarn" />
    </a>
  </summary>

```sh
yarn add is-zod
```

</details>

<details>
  <summary>
    <img src="https://img.shields.io/badge/pnpm-F69220?logo=pnpm&logoColor=white" alt="PNPM" />
  </summary>

```sh
pnpm add is-zod
```

</details>

<details>
  <summary>
    <img src="https://img.shields.io/badge/bun-EE81C3?logo=bun&logoColor=white" alt="Bun" />
  </summary>

```sh
bun add is-zod
```

</details>
<!-- END INSTALLATION -->

## Usage

### Is

```ts
import { z } from "zod";
import is from "is-zod";

const user = z.object({
  name: z.string(),
  age: z.number()
});

const value = {
  name: "Bob",
  age: 42
};

if (is(value, user)) {
  // value is typed as { name: string; age: number; }
}
```

### Validate

```ts
import { z } from "zod";
import { validate } from "is-zod";

const user = z.object({
  name: z.string(),
  age: z.number()
});

const isUser = validate(user);

const value = {
  name: "Bob",
  age: 42
};

if (isUser(value)) {
  // value is typed as { name: string; age: number; }
}
```

<!--BEGIN FOOTER-->
<h2 id="dependencies">Dependencies<a href="https://www.npmjs.com/package/is-zod?activeTab=dependencies"><img align="right" alt="dependencies" src="https://img.shields.io/librariesio/release/npm/is-zod.svg"></a></h2>

- [zod](https://www.npmjs.com/package/zod): TypeScript-first schema declaration and validation library with static type inference

<h2 id="license">License <a href="https://opensource.org/licenses/MIT"><img align="right" alt="license" src="https://img.shields.io/npm/l/is-zod.svg"></a></h2>

[MIT](https://opensource.org/licenses/MIT) - _MIT License_
<!--END FOOTER-->

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