terminal-menu example [nodejitsu, Node.js, cli and npmawesome]

Forked from Hello World for Node.js.

205 Runs 335 Views 38 Copies

`teminal-menu` example

Saved

Saved

alexgorbatchev 15

alexgorbatchev
published 6 months ago

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

var menu = terminalMenu({
  width: 60,
  bg: 102,
  x: 4,
  y: 2
});

menu.reset();
menu.write('Recently on our blog\n');
menu.write('-------------------------\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) {
    menu.close();
    console.log('You selected:');
    console.log(index, label);
});

menu.createStream().pipe(process.stdout);

Terminal

Your session has timed out.

Dismiss (the page may not function properly).