Answers for "commander js"

0

commander js

const { Command } = require('commander')
const program = new Command()

program  
  .option('-d, --debug', 'output extra debugging')  
  .option('-s, --small', 'small pizza size')  
  .option('-p, --pizza-type <type>', 'flavour of pizza', 'peperoni') // default
  .parse(process.argv)

if (program.debug) 
  console.log(program.opts())
console.log('pizza details:')
if (program.small)
  console.log('- small pizza size')
if (program.pizzaType)
  console.log(`- ${program.pizzaType}`);
Posted by: Guest on July-21-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language