Save time managing and deploying your node.js app

Nodejitsu has joined GoDaddy

We are excited to join GoDaddy to help spearhead their largest Node.js product: Website Builder. Please read our blog post to learn more about customer transition plans and our continued support for Open Source within the node community.

Want to know all the details?
Read the full blog post or read the GoDaddy Announcement.

npmawesome: Multiple choice user prompt for CLI tools using terminal-menu

About the author

nodejitsu nodejitsu

Other popular posts

- Scaling Isomorphic Javascript Code - Keep a node.js server up with Forever - Package.json dependencies done right
- npm cheat sheet - 6 Must Have Node.js Modules

This is a guest post from Alex Gorbatchev and Nodejitsu loved what Alex was doing at and is now supporting the project. Like what you see here? Why don't you contribute on Github?

Lets continue building out awesome CLI (command line interface) tool. Previously we have discussed how to take in command line arguments, output tabular data and display progress of long running tasks.

Prompting a user with options and asking to pick one is a fairly common scenario. Most of the time you get to read the options and press associated key. That works, but we are human and like pretty interfaces. Same thing can be achieved with a common menu interface. This is where terminal-menu (Github: substack/terminal-menu, License: MIT) by James Halliday comes in.

npm install terminal-menu


There are a few options available to customize the menu such as:

  • Background color
  • Foreground color
  • Position
  • Width
  • Padding


var terminalMenu = require('terminal-menu');

var menu = terminalMenu({
  width: 60,
  x: 4,
  y: 2

menu.write('Recently on our blog\n');

menu.add('How to setup a multi-user Ghost blog');
menu.add('Patched PaaS Vulnerability');
menu.add('npmawesome: Progress reporting in CLI applications');
menu.add('Improved SSL experience for private npm');
menu.add('npmawesome: Table formatting in the terminal with...');

menu.on('select', function (label, index) {
  console.log('You selected:');
  console.log(index, label);


Check out interactive example on runnable.

Other modules to checkout

Generally there is a list of alternative modules here, but as strange as it sounds, I couldn't find any. If you know of one, please drop us a line.

Closing thoughts

Over the last couple of CLI related posts we've progressively been improving user experience of our terminal application. I feel that you can never spend too much time doing this, but you can definetely spend too little. I love little things that feel good. terminal-menu was created for stream-adventure, an educational terminal based stream adventure game for Node.js and stream-adventure in turn inspired browser based version written by John Resig of the jQuery fame. Both are pretty cool and fun!