const prompt = require('prompt-ajv');
const obj = 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);
caub/prompt-ajv
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published