MCPcopy
hub / github.com/vercel/hyper / columnify

Function columnify

cli/index.ts:35–49  ·  view source on GitHub ↗
(data: {name: string; description: string}[])

Source from the content-addressed store, hash-verified

33};
34
35const 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
51args.command(
52 'install',

Callers 1

index.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected