1.0.2 • Published 7 years ago

shell-helper v1.0.2

Weekly downloads
5
License
MIT
Repository
github
Last release
7 years ago

shell-helper

Random helper functions for command based operations See sample.js for usage.

  • getAnswer
const s = require('shell-helper')
s.getAnswer('What is your name').then(name => console.log(`Your name is ${name}.`))
  • getAnswer with accepts option
const s = require('shell-helper')
s.getAnswer('What is your favorite color', {accepts: ['red', 'blue']})
  .then(color => console.log(`Your favorite color is ${color}.`))
  • askYesNo
const s = require('shell-helper')
s.askYesNo(`Are you sure`, true).then(answer => console.log(`You answered : ${answer}`))
  • pickList
const s = require('shell-helper')
s.pickList(`Pick your number`, ['1', '3', '5']).then(answer => console.log(`Your chosen index : ${answer}`));
  • showProgress
const s = require('shell-helper')
s.showProgress(`Operation in progress`, someKindOfPromise).then(ret => console.log(`Returned value : ${ret}`));