loading...

TTY::Prompt, TTY not!

meemeek profile image Randi Schreiner Updated on ・2 min read

I am just finishing up building my first project for Flatiron School this week and of all the new things I learned - which there were A LOT! - I think TTY::Prompt was the most useful and absolutely wonderful! Now, I want to also take a second to give props to Colorize, Lolize and Rainbow because life is better more colorful! These gems are also excellent and I recommend each of them.

But TTY::Prompt has been a life-changer for me. I used this in so many places throughout my project, in many different forms. This project would have never been the same without it. And it is so easy to use! There are tons of options but I will show you a few of the ones I found most useful.

Prompt.select

Prompt.select was my go to and so versatile. I used this in so many different ways. My absolute favorite thing about it was that I could pull in an array from my program to use as the selection options - amazing! This kept my program fluid and was so easy to write.

Alt Text

Prompt.ask

Probably the most straightforward and often needed use would be the Prompt.ask function. It's simple but it has a ton of additional options if you need them. You can simply take input from the user, but you can also use this to validate the information given or capitalize it. Again, it was so easy to use and allows so much flexibility.

So much more

There were so many other options available that I didn't have reason to use with this program but I can assure you, I will be using TTY::Prompt again. I can't wait to have reason to use TTY::Mask and change the image used to mask the input! What an exciting and fun idea for the right website.

Be sure to check it out. https://github.com/piotrmurach/tty-prompt#ttyprompt

If anyone has any other suggestions of gems I should try out, let me know. I am always excited to learn new things and keep expanding my grab bag of fun tricks and treats!

Discussion

pic
Editor guide