improves block functionality
adds cli compatible prompts/logs adds logfile function for debug adds multiselect support new fieldRename adds listFieldNames
This commit is contained in:
21
cli/style.ts
Normal file
21
cli/style.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
const colorMap = {
|
||||
purple: "\x1b[35m",
|
||||
porple: "\x1b[38;2;150;0;200m",
|
||||
red: "\x1b[31m",
|
||||
green: "\x1b[32m",
|
||||
yellow: "\x1b[33m",
|
||||
blue: "\x1b[34m",
|
||||
cyan: "\x1b[36m",
|
||||
white: "\x1b[37m",
|
||||
gray: "\x1b[90m",
|
||||
get grey() {
|
||||
return this.gray;
|
||||
},
|
||||
};
|
||||
|
||||
export function colorize(text: string, color?: keyof typeof colorMap | string) {
|
||||
if (!color) return text;
|
||||
const c = colorMap[color as keyof typeof colorMap];
|
||||
if (!c) return text;
|
||||
return `${c}${text}\x1b[0m`;
|
||||
}
|
Reference in New Issue
Block a user