consola icon indicating copy to clipboard operation
consola copied to clipboard

Mask / disable sensitive input characters

Open Eckhardt-D opened this issue 2 years ago • 2 comments

Describe the feature

As a user, if I'm prompted to enter a sensitive string like a password, apiKey etc. I want to be able to paste / type it without stdout echoing it back to me. Like with the -s flag in bash's read. Or stty.

I see there is an exported password type, so perhaps already in development?

API changes suggestions:

add secureText as a type option to the prompt method.

Additional information

  • [ ] Would you be willing to help implement this feature?

Eckhardt-D avatar May 26 '23 10:05 Eckhardt-D

you could look at a library like redact-pii for that

georgzoeller avatar Jun 29 '23 13:06 georgzoeller

I like such idea very much. We might need to make it opt-in as non breaking change also probably a similar alternative of rework of redact-pii without lodash dependency and maintained.

pi0 avatar Jun 30 '23 09:06 pi0