# prompt-ajv

> prompt with ajv validation

Latest version **3.0.0** (published 2026-09-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install prompt-ajv
pnpm add prompt-ajv
yarn add prompt-ajv
bun add prompt-ajv
```

## Health

**Score 55/100 (C)** — status: active.

Positive: no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2026-09-10 |
| First published | 2022-01-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | caub |
| Maintainers | caub |
| Keywords | prompt, ajv, repl |

## Links

- npm: https://www.npmjs.com/package/prompt-ajv
- Repository: https://github.com/caub/prompt-ajv
- Homepage: https://github.com/caub/prompt-ajv#readme
- Issues: https://github.com/caub/prompt-ajv/issues
- npm.io page: https://npm.io/package/prompt-ajv

## Alternatives

- [localforage](https://npm.io/package/localforage.md) — 6.2M weekly downloads
- [localforage-observable](https://npm.io/package/localforage-observable.md) — 30.8K weekly downloads
- [@y/y](https://npm.io/package/@y/y.md) — 30.1K weekly downloads
- [@metaobjectsdev/render](https://npm.io/package/@metaobjectsdev/render.md) — 3.5K weekly downloads
- [@ledgerhq/coin-algorand](https://npm.io/package/@ledgerhq/coin-algorand.md) — 1.1K weekly downloads

## Recent versions

- 3.0.0 (latest) — 2026-09-10
- 2.0.0 — 2025-12-21
- 1.0.0 — 2022-01-31

## README

# prompt-ajv

Prompts on the command line, validated with [ajv](https://ajv.js.org) (including [ajv-formats](https://github.com/ajv-validator/ajv-formats) keywords like `email`, `date`, `uri`, etc).

Works from both ESM and CommonJS.

```js
// ESM
import prompt from 'prompt-ajv';

// CommonJS
const prompt = require('prompt-ajv');

const obj = await prompt({
  name: { type: 'string', minLength: 2, required: true },
  email: { type: 'string', format: 'email' },
  pw: { type: 'string', secret: true },
  size: { type: 'string', enum: ['xs', 'sm', 'lg'], default: 'sm' },
  age: { type: 'integer', description: 'How old ru?', minimum: 0, maximum: 150 },
  height: { type: 'number', description: 'Height in meters?', minimum: 0, maximum: 2.8, default: 1.8 },
});

console.log('obj:', obj);
```

Requires `ajv` and `ajv-formats` as peer dependencies:

```
npm i prompt-ajv ajv ajv-formats
```

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