function-color 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,58 @@
1
+ # function-color
2
+
3
+ Extensão para colorir texto ASCII
4
+
5
+ ## ✨ Sobre
6
+
7
+ Este pacote permite que você converta textos em arte ASCII estilizada (fonte Bloody) e aplique cores facilmente usando métodos como `.red`, `.blue`, etc. Basta importar o pacote e usar as extensões de cor diretamente em qualquer string!
8
+
9
+ ## 🚀 Instalação
10
+
11
+ ```bash
12
+ npm install function-color
13
+ ```
14
+
15
+
16
+ ## 🔧 Uso
17
+
18
+ ```js
19
+ const color = require('function-color');
20
+
21
+ console.log('oi'.red); // Exibe o texto 'oi' em ASCII (fonte Bloody) e na cor vermelha
22
+ console.log('hello world'.blue); // Exibe em azul
23
+ ```
24
+
25
+ ## 🎨 Cores suportadas
26
+
27
+ - red
28
+ - green
29
+ - yellow
30
+ - blue
31
+ - magenta
32
+ - cyan
33
+ - white
34
+ - gray
35
+ - black
36
+ - bgRed
37
+ - bgGreen
38
+ - bgYellow
39
+ - bgBlue
40
+ - bgMagenta
41
+ - bgCyan
42
+ - bgWhite
43
+
44
+ ## 📦 Exemplo completo
45
+
46
+ ```js
47
+ require('function-color');
48
+
49
+ console.log('Exemplo'.magenta);
50
+ console.log('Outro exemplo'.bgYellow);
51
+ ```
52
+
53
+ ## ❤️ Créditos
54
+ - [chalk](https://www.npmjs.com/package/chalk) para colorização de terminal
55
+
56
+ ---
57
+
58
+ Feito com dedicação por DallasCorp.
package/example.js ADDED
@@ -0,0 +1,3 @@
1
+ require("./index");
2
+
3
+ console.log("oi".red);
package/index.js ADDED
@@ -0,0 +1,19 @@
1
+ const asciiArt = require('function-flag');
2
+ const chalk = require('chalk');
3
+
4
+ const colors = [
5
+ 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white', 'gray', 'black',
6
+ 'bgRed', 'bgGreen', 'bgYellow', 'bgBlue', 'bgMagenta', 'bgCyan', 'bgWhite',
7
+ ];
8
+
9
+ colors.forEach(color => {
10
+ Object.defineProperty(String.prototype, color, {
11
+ get: function() {
12
+ asciiArt(this.toString(), 'Bloody');
13
+ return chalk[color](this.toString());
14
+ },
15
+ configurable: true
16
+ });
17
+ });
18
+
19
+ module.exports = {};
package/package.json ADDED
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "function-color",
3
+ "version": "1.0.0",
4
+ "description": "Extensão para colorir texto ASCII ",
5
+ "main": "index.js",
6
+ "keywords": [
7
+ "ascii",
8
+ "color",
9
+ "chalk",
10
+ "function-flag"
11
+ ],
12
+ "author": "DallasCorp",
13
+ "license": "ISC",
14
+ "dependencies": {
15
+ "chalk": "^4.1.2",
16
+ "function-flag": "^4.0.0"
17
+ }
18
+ }