How to use the config function from commander
Find comprehensive JavaScript commander.config code examples handpicked from public code repositorys.
GitHub: tidev/alloy
93 94 95 96 97 98 99 100 101 102
// Setup up logging output Error.stackTraceLimit = Infinity; logger.stripColors = program['colors'] === false; logger.logLevel = program['logLevel'] || logger.TRACE; if (program.config && program.config.indexOf('logLevel') !== -1) { logger.logLevel = -1; } if (!program.noBanner && program.args[0] !== 'info' && (program.config && program.config.indexOf('noBanner') === -1)) {
928
958
141
+ 3 other calls in file
GitHub: webuildsg/live-server
13 14 15 16 17 18 19 20 21
} /*Get config from json file*/ var fs = require('fs'); var file = __dirname + "/" + program.config; fs.readFile(file, 'utf8', function (err, data) { if (err) {console.dir(err); return;}
2
4
10
196 197 198 199 200 201 202 203 204 205
let configExplorerResult; let configFile: ConfigurationFileInterface = {}; if (program.config) { let configFilePath = program.config; let testConfigFilePath = configFilePath.match(process.cwd()); if (testConfigFilePath && testConfigFilePath.length > 0) { configFilePath = configFilePath.replace(process.cwd() + path.sep, ''); }
385
2
0
GitHub: Jonekee/logger-app
75 76 77 78 79 80 81 82 83 84 85
process.exit(0); } if (!!program.config) { LoggingManager.system('APP', 'main', 'Using config file: ' + program.config); configFile = program.config; } else { LoggingManager.fatal('APP', 'main', 'Error: No config file specified!'); LoggingManager.fatal('APP', 'main', 'Use --config [file] to specify a config file or --newconfig [file] to create one.'); process.exit(1);
0
0
0
+ 2 other calls in file
commander.Option is the most popular function in commander (1786 examples)