dumfunctions
Advanced tools
Comparing version 1.0.3 to 1.0.4
23
main.js
@@ -128,3 +128,22 @@ /** | ||
function logStyle(text, type, color) { | ||
if (type.toLowerCase() == "text") { | ||
if (color.toLowerCase() == "red") return `\u001b[0;31m${text}\u001b[0;0m`; | ||
if (color.toLowerCase() == "green") return `\u001b[0; 32m${text}\u001b[0;0m`; | ||
if (color.toLowerCase() == "yellow") return `\u001b[0; 33m${text}\u001b[0;0m`; | ||
if (color.toLowerCase() == "blue") return `\u001b[0; 34m${text}\u001b[0;0m`; | ||
if (color.toLowerCase() == "purple") return `\u001b[0; 35m${text}\u001b[0;0m`; | ||
if (color.toLowerCase() == "cyan") return `\u001b[0; 36m${text}\u001b[0;0m`; | ||
} | ||
if (type.toLowerCase() == `background`) { | ||
if (color.toLowerCase() == "red") return `\u001b[0;41m${text}\u001b[0;0m`; | ||
if (color.toLowerCase() == "green") return `\u001b[0; 42m${text}\u001b[0;0m`; | ||
if (color.toLowerCase() == "yellow") return `\u001b[0; 43m${text}\u001b[0;0m`; | ||
if (color.toLowerCase() == "blue") return `\u001b[0; 44m${text}\u001b[0;0m`; | ||
if (color.toLowerCase() == "purple") return `\u001b[0; 45m${text}\u001b[0;0m`; | ||
if (color.toLowerCase() == "cyan") return `\u001b[0; 46m${text}\u001b[0;0m`; | ||
} | ||
} | ||
module.exports = { | ||
@@ -145,4 +164,6 @@ // randoms | ||
toTitleCase: toTitleCase, | ||
toStringCase: toStringCase | ||
toStringCase: toStringCase, | ||
logStyle: logStyle | ||
}; |
{ | ||
"name": "dumfunctions", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "A package for JS functions that should be in the main language but aren't.", | ||
@@ -5,0 +5,0 @@ "main": "main.js", |
8255
146