An open API service indexing awesome lists of open source software.

https://github.com/caub/prompt-ajv


https://github.com/caub/prompt-ajv

Last synced: about 2 months ago
JSON representation

Awesome Lists containing this project

README

          

# prompt-ajv

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

const obj = await prompt({
name: { type: 'string', minLength: 2, required: true },
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);
```