-
Notifications
You must be signed in to change notification settings - Fork 1
/
printModule.js
58 lines (49 loc) · 1.62 KB
/
printModule.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
export const printC = async (value="",tag="",name="",colour="") => {
printText = ""
if (name!=""){
printText = name + ": "
if (tag!=""){
printText = printText + tag + ": "
}
} else {
if (tag!=""){
printText = " General - ", tag + ": "
}
}
if (value!=""){
if (colour=="r"){
console.log('\x1b[31m%s\x1b[0m', printText, value);
} else if (colour=="g"){
console.log('\x1b[32m%s\x1b[0m', printText, value);
} else if (colour=="gr"){
console.log('\x1b[30m%s\x1b[0m', printText, value);
} else if (colour=="p"){
console.log('\x1b[35m%s\x1b[0m', printText, value);
} else if (colour=="b"){
console.log('\x1b[34m%s\x1b[0m', printText, value);
} else if (colour=="y"){
console.log('\x1b[33m%s\x1b[0m', printText, value);
} else {
console.log(printText, value);
}
} else {
if (colour=="r"){
console.log('\x1b[31m%s\x1b[0m', printText);
} else if (colour=="g"){
console.log('\x1b[32m%s\x1b[0m', printText);
} else if (colour=="b"){
console.log('\x1b[34m%s\x1b[0m', printText);
} else if (colour=="y"){
console.log('\x1b[33m%s\x1b[0m', printText);
} else if (colour=="p"){
console.log('\x1b[35m%s\x1b[0m', printText);
} else if (colour=="gr"){
console.log('\x1b[30m%s\x1b[0m', printText);
} else {
console.log(printText);
}
}
}
module.exports = {
printC,
};