@panzi/getpass
    Preparing search index...

    Interface GetPassOptions

    Options for getPass.

    interface GetPassOptions {
        bufferSize?: number;
        echoChar?: string;
        echoCharWidth?: number;
        echoRepeat?: [number, number];
        encoding?: Encoding;
        errors?: EncodingErrors;
        escapeTimeout?: number;
        prompt?: string;
        repeatDelay?: [number, number];
        signal?: AbortSignal;
        tty?: string;
    }
    Index

    Properties

    bufferSize?: number

    Initial buffer size, can grow if needed.

    2048
    
    echoChar?: string

    Print this character when the user types.

    May not include codepoints in the range of U+0000 to U+001F (inclusive). These are things like \t, \n, Escape etc.

    '*'
    
    echoCharWidth?: number

    Display width of echoChar.

    If not given it is attempted to determine the display width with this fallback list of libraries:

    If none of them are available this fallback method is used:

    echoChar.replace(/([^\n])\p{Mn}+/gu, '$1').replace(/\p{Emoji_Presentation}/gu, 'xx').length
    
    echoRepeat?: [number, number]

    A [min, max] tuple of integers.

    The echoChar is randomly repeated n times where min <= n and n <= max. If echoChar is passed but echoRepeat isn't, then the echoChar is written exactly once by input byte. This is to obfuscate the password length for anyone snooping.

    undefined
    
    encoding?: Encoding

    Parse input to string using this encoding.

    If 'binary' is passed getPass will return a Buffer object.

    'utf-8'
    

    How do handle encoding errors.

    'surrogateescape'
    
    escapeTimeout?: number

    Milliseconds to wait for an escape character to be accepted as the user wanting to abort.

    A single escape character might be the start of an escape sequence or the user pressing escape in order to abort input. The only way to distinguish between the two is to wait for more input and if none (or a second escape) comes its the user wanting to abort.

    25
    
    prompt?: string

    Prompt to display.

    'Password: '
    
    repeatDelay?: [number, number]

    A [min, max] tuple of integers.

    This is a range for a random delay in milliseconds between the repeated echoChar prints or deletions on backspace. This is to make the repeated echoChars look more realistic.

    [5,50]
    
    signal?: AbortSignal

    Abort prompt (return null) when this signal fires.

    tty?: string

    TTY device to open.

    '/dev/tty' with fallback to '/dev/stdin' + '/dev/stdout'