# vality

> A TypeScript schema descriptor library with zero dependencies.

Latest version **6.3.4** (published 2024-02-13) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 6.3.4 |
| Published | 2024-02-13 |
| First published | 2022-08-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 195.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 9 |
| Author | Jesper Engberg |
| Maintainers | jeengbe |
| Keywords | javascript, typescript, schema, validation, transformer |

## Links

- npm: https://www.npmjs.com/package/vality
- Repository: https://github.com/jeengbe/vality
- Homepage: https://jeengbe.github.io/vality
- Issues: https://github.com/jeengbe/vality/issues
- npm.io page: https://npm.io/package/vality

## Alternatives

- [vest](https://npm.io/package/vest.md) — 50.1K weekly downloads
- [@regle/core](https://npm.io/package/@regle/core.md) — 47.0K weekly downloads
- [typeof-arguments](https://npm.io/package/typeof-arguments.md) — 12.5K weekly downloads
- [@lokalise/projects-engine-contracts](https://npm.io/package/@lokalise/projects-engine-contracts.md) — 978 weekly downloads
- [@osjwnpm/nam-laboriosam-quibusdam](https://npm.io/package/@osjwnpm/nam-laboriosam-quibusdam.md) — 70 weekly downloads

## Recent versions

- 6.3.4 (latest) — 2024-02-13
- 6.3.3 — 2023-06-10
- 6.3.2 — 2023-02-25
- 6.3.1 — 2023-01-08
- 6.3.0 — 2023-01-08
- 6.2.2 — 2022-11-15
- 6.2.1 — 2022-11-15
- 6.2.0 — 2022-11-15
- 6.1.1 — 2022-11-15
- 6.1.0 — 2022-11-15
- 6.0.3 — 2022-11-14
- 6.0.2 — 2022-11-14
- 6.0.1 — 2022-11-14
- 6.0.0 — 2022-11-14
- 5.2.4 — 2022-10-03
- … 45 more at https://npm.io/package/vality/versions

## README

<h1 align="center">Vality</h1>
<div align="center">

A TypeScript schema descriptor library with zero dependencies.

[![License](https://img.shields.io/npm/l/vality)](https://github.com/jeengbe/vality/blob/master/packages/vality/LICENSE.md)
[![Version](https://img.shields.io/npm/v/vality)](https://www.npmjs.com/package/vality)
[![Build Status](https://img.shields.io/github/actions/workflow/status/jeengbe/vality/ci.yml?brach=master)](https://github.com/jeengbe/vality)
[![Coverage Status](https://img.shields.io/codecov/c/github/jeengbe/vality/master?flag=vality&token=L0QZW59UTU)](https://app.codecov.io/gh/jeengbe/vality/tree/master/packages/vality)

[![Snyk](https://img.shields.io/snyk/vulnerabilities/github/jeengbe/vality)](https://snyk.io/test/github/jeengbe/vality)
[![Dependencies](https://img.shields.io/badge/dependencies-0-brightgreen)](https://github.com/jeengbe/vality/network/dependencies)
[![Bundlephobia](https://img.shields.io/bundlephobia/minzip/vality)](https://bundlephobia.com/package/vality)

See https://jeengbe.github.io/vality for more information.

</div>

Vality is the heart of this repository. It is a declarative **schema description library** with the most **intuitive syntax** and allows for validation and transformation of data. Then extract the types from your schema for **100% type safety**. And all with **0 runtime dependencies**.

Find all of this and much more on https://jeengbe.github.io/vality/vality.

```ts
import { v, Parse } from "vality";

const Person = {
  name: v.string,
  age: v.number({ min: 6 }),
  email: v.email,
  referral: ["friends", "ad", "media", null],
  languages: [["de", "en", "fr", "se"]],
} as const;

type Person = Parse<typeof Person>;
/* {
  name: string;
  age: number;
  email: Email;
  referral: "friends" | "ad" | "media" | null;
  languages: ("de" | "en" | "fr" | "se")[];
} */
```

Now that I have your attention, head over to https://jeengbe.github.io/vality/vality to find out what's going on here. You won't regret it ;)

Or head to [GitHub](https://github.com/jeengbe/vality) to find more useful packages (such as [Vality ESLint Plugin](https://github.com/jeengbe/vality/tree/master/packages/eslint-plugin-vality)).

And before you complain about errors, make sure your tsconfig supports at least the following:
```json
{
  "compilerOptions": {
    "strictNullChecks": true,
    "lib": ["ES2015"]
  }
}
```

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