How to use the prompt function from commander

Find comprehensive JavaScript commander.prompt code examples handpicked from public code repositorys.

6
7
8
9
10
11
12
13
14
15


module.exports = function(options) {
  var pkg = iduri.resolve(options.query);
  if (!pkg.version) {
    commander.prompt('  are you sure to delete all versions? (y/N) ', function(sure) {
      console.log();
      if (sure.charAt(0).toLowerCase() === 'y') {
        unpublish(options, pkg);
      } else {
fork icon26
star icon126
watch icon26

+ 3 other calls in file

18
19
20
21
22
23
24
25
26
27
  });
};


function register(options) {
  commander.prompt({
    username: '  username: ',
    email: '  email: '
  }, function(info) {
    commander.password('  password: ', function(password) {
fork icon26
star icon126
watch icon26

+ 23 other calls in file

148
149
150
151
152
153
154
155
156
157
if (!auth) {
  prompt.user = 'Enter your saucelab\'s username: ';
  prompt.key = 'Enter your saucelab\'s access key: ';
}

program.prompt(prompt, function(obj) {
  auth = auth || obj.user + ':' + obj.key;
  browsers = browsers || obj.browsers;

  // auth
fork icon9
star icon99
watch icon6

37
38
39
40
41
42
43
44
45
46
  });
}

function askUserName(callback) {
  if (!username) {
    commander.prompt('Enter user name: ', function (data) {
      username = data;
      callback();
    });
  }
fork icon4
star icon15
watch icon32

+ 7 other calls in file

9
10
11
12
13
14
15
16
17
18
    }
  });
}

var login = function (callback) {
  program.prompt('Username: ', function(username){
    program.password('Password: ', '*', function(password){
      keychain.setPassword({ account: 'lightmanUsername', service: 'lightman', password: username }, function(err) {
        keychain.setPassword({ account: 'lightmanPassword', service: 'lightman', password: password }, function(err) {
          process.stdin.destroy();
fork icon3
star icon4
watch icon1

Other functions in commander

Sorted by popularity

function icon

commander.Option is the most popular function in commander (1786 examples)