https://github.com/caub/prompt-ajv
https://github.com/caub/prompt-ajv
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/caub/prompt-ajv
- Owner: caub
- Created: 2022-01-31T22:25:26.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-01-31T22:44:56.000Z (over 4 years ago)
- Last Synced: 2024-04-24T17:39:41.375Z (about 2 years ago)
- Language: JavaScript
- Size: 1000 Bytes
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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);
```