awesome-logging

Advanced logging messages, interactive prompts, loading animations and more in TypeScript

Downloads
900
Stars
14
Committers
3
awesome-logging - v1.1.0 Latest Release

Published by LoaderB0T almost 2 years ago

TextPrompt

validator function config option replaced by validators array:

const c = AwesomeLogger.prompt('text', {
  text: 'Please enter your phone number:',
  validators: [
    {
      description: 'The minimal input length is 8',
      validator: (input: string) => {
        return input.length >= 8;
      }
    },
    {
      description: 'Your input has to start with "+"',
      validator: (input: string) => {
        return input.startsWith('+');
      }
    }
  ]
});

Validator descriptions will be rendered to users if they try to confirm the prompt with an invalid input.

Example:
image