| 33 | }; |
| 34 | |
| 35 | const columnify = (data: {name: string; description: string}[]) => { |
| 36 | const maxNameLength = Math.max(...data.map((entry) => entry.name.length), 0); |
| 37 | const descriptionWidth = process.stdout.columns - maxNameLength - 1; |
| 38 | return _columnify(data, { |
| 39 | showHeaders: false, |
| 40 | config: { |
| 41 | description: { |
| 42 | maxWidth: descriptionWidth |
| 43 | }, |
| 44 | name: { |
| 45 | dataTransform: (nameValue) => chalk.green(nameValue) |
| 46 | } |
| 47 | } |
| 48 | }).replace(/\s+$/gm, ''); // remove padding from the end of all lines |
| 49 | }; |
| 50 | |
| 51 | args.command( |
| 52 | 'install', |