How to use the input function from commander

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

51
52
53
54
55
56
57
58
59
60
function getInput(callback) {
  var input = '';

  if (program.input) {
    var inputPath = path.isAbsolute(program.input)
      ? program.input
      : path.join(process.cwd(), program.input);

    if (program.ldjson) {
      fs.readFile(inputPath, 'utf8', function (err, data) {
fork icon377
star icon0
watch icon2

39
40
41
42
43
44
45
46
47
48
49
50
51
initArgs(args, !!(args.broadcast || args.key.length || args.keys))
if (!(args.input.length || args.key.length) || !args.output.length) args.help()


if (args.key.length) info('loading unspent outputs for', C.yellowBright(args.key.length), 'keys')


keysUtxo(args.key, args).then(inputs => args.input.concat(inputs)).then(inputs => {
  if (!inputs.length) return Promise.reject('no unspent outputs found for the provided key(s)')


  const tx = makeTx(inputs, args.output, args.feerate)
  if (!args.crazyfee) checkFee(tx)
fork icon16
star icon28
watch icon0

12
13
14
15
16
17
18
19
20
21
  .usage('[options] [RAML input file]')
  .option('-i, --input [input]', 'RAML input file')
  .option('-o, --output [output]', 'Expanded RAML output file')
  .parse(process.argv);

var input = program.input;

if (!input) {
  if (program.args.length !== 1) {
    console.error('Error: You need to specify the RAML input file');
fork icon7
star icon0
watch icon0

70
71
72
73
74
75
76
77
78
79
80
81
}
if (program.start !== undefined){
    nodeIdCounter = parseInt(program.start);
}


var dirname = program.input;
var filename = "";


var requiredModules = new Set(),
    analyzedModules = [];
fork icon1
star icon0
watch icon1

1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
  .option('-o, --output_dir <string>', 'output file setting, dataset.json')
  .parse(process.argv);

// console.log(program.cheese)

input_file = program.input
directory = program.output_dir

if (!fs.existsSync(directory)) {
  fs.mkdirSync(directory);
fork icon0
star icon0
watch icon0

Other functions in commander

Sorted by popularity

function icon

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