const cmd = 'ls'; let params = []; if (options.all) params.push('a'); if (options.long) params.push('l'); let fullCommand = params.length ? cmd + ' -' + params.join('') : cmd if (directory) fullCommand += ' ' + directory;
Writing Command-Line Applications in NodeJS
Peter Benjamin
1.3K13

Any reason not to indent?