chromalogger 1.1.0 → 1.1.1
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 +114 -8
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -1,26 +1,132 @@
|
|
|
1
|
-
#
|
|
1
|
+
# ChromaLogger
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/chromalogger)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
[](https://github.com/OrssiMp/chromalogger/stargazers)
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
ChromaLogger est une bibliothèque Node.js puissante et flexible pour la journalisation de console avec un support avancé des couleurs et des styles. Parfaite pour le développement et le débogage d'applications Node.js.
|
|
8
|
+
|
|
9
|
+
## ✨ Fonctionnalités
|
|
10
|
+
|
|
11
|
+
- 🎨 Messages de console colorés et stylisés
|
|
12
|
+
- 📊 Plusieurs niveaux de logs (log, debug, info, warn, error)
|
|
13
|
+
- 🛠️ Interface de ligne de commande (CLI) intégrée
|
|
14
|
+
- 🔧 Personnalisation facile des styles et formats
|
|
15
|
+
- 📦 Compatible ES Modules et CommonJS
|
|
16
|
+
- 🚀 Légère et sans dépendances inutiles
|
|
17
|
+
|
|
18
|
+
## 📦 Installation
|
|
6
19
|
|
|
7
20
|
```bash
|
|
8
|
-
|
|
21
|
+
# Avec npm
|
|
22
|
+
npm install chromalogger
|
|
23
|
+
|
|
24
|
+
# Ou avec Yarn
|
|
25
|
+
yarn add chromalogger
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## 🎨 Utilisation de la fonction `chroma`
|
|
29
|
+
|
|
30
|
+
La fonction `chroma` vous permet de créer des messages colorés avec une grande flexibilité :
|
|
31
|
+
|
|
32
|
+
```javascript
|
|
33
|
+
import { chroma } from 'chromalogger';
|
|
34
|
+
|
|
35
|
+
// Utilisation de base
|
|
36
|
+
console.log(chroma('Texte en rouge', 'red'));
|
|
37
|
+
console.log(chroma('Texte en vert sur fond jaune', 'green', 'bgYellow'));
|
|
38
|
+
|
|
39
|
+
// Chaînage des styles
|
|
40
|
+
console.log(chroma('Texte en gras et souligné', 'bold', 'underline'));
|
|
41
|
+
|
|
42
|
+
// Avec des templates strings
|
|
43
|
+
const user = 'Alice';
|
|
44
|
+
console.log(chroma`Bonjour ${user}, ceci est un ${'message important'.red.bold} !`);
|
|
45
|
+
|
|
46
|
+
// Styles disponibles :
|
|
47
|
+
// Couleurs : black, red, green, yellow, blue, magenta, cyan, white
|
|
48
|
+
// Arrière-plans : bgBlack, bgRed, bgGreen, bgYellow, bgBlue, bgMagenta, bgCyan, bgWhite
|
|
49
|
+
// Styles : bright, dim, italic, underline, blink, reverse, hidden, strikethrough
|
|
9
50
|
```
|
|
10
51
|
|
|
11
|
-
## Utilisation
|
|
52
|
+
## 🚀 Utilisation de base
|
|
12
53
|
|
|
13
54
|
### Avec ES Modules (recommandé)
|
|
14
55
|
|
|
15
56
|
```javascript
|
|
16
|
-
import
|
|
57
|
+
import { log, info, warn, error, createLogger } from 'chromalogger';
|
|
58
|
+
|
|
59
|
+
// Utilisation des loggers prédéfinis
|
|
60
|
+
log('Message standard');
|
|
61
|
+
info('Information importante');
|
|
62
|
+
warn('Attention !');
|
|
63
|
+
error('Erreur critique !');
|
|
64
|
+
|
|
65
|
+
// Création d'un logger personnalisé
|
|
66
|
+
const customLogger = createLogger('magenta', 'underline');
|
|
67
|
+
customLogger('Message personnalisé');
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Avec CommonJS
|
|
71
|
+
|
|
72
|
+
```javascript
|
|
73
|
+
const { log, info, warn, error } = require('chromalogger');
|
|
74
|
+
|
|
75
|
+
// Utilisation des loggers
|
|
76
|
+
log('Message standard');
|
|
77
|
+
info('Information');
|
|
78
|
+
warn('Avertissement');
|
|
79
|
+
error('Erreur');
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## 🛠️ Interface en Ligne de Commande (CLI)
|
|
83
|
+
|
|
84
|
+
ChromaLogger inclut un utilitaire en ligne de commande `clog` :
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
# Afficher l'aide
|
|
88
|
+
npx clog --help ou clog --help
|
|
89
|
+
|
|
90
|
+
# Afficher un message simple
|
|
91
|
+
npx clog "Mon message" ou clog "Mon message"
|
|
92
|
+
|
|
93
|
+
# Utiliser des couleurs et styles
|
|
94
|
+
npx clog --color red --style bright "Message d'erreur important" / clog --color red --style bright "Message d'erreur important"
|
|
95
|
+
|
|
96
|
+
clog --color red --style bright "Message d'erreur important" / clog --color red --style bright "Message d'erreur important"
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## 📚 Documentation Complète
|
|
100
|
+
|
|
101
|
+
Pour plus d'informations sur les fonctionnalités avancées, consultez la [documentation complète](https://github.com/OrssiMp/chromalogger#readme).
|
|
102
|
+
|
|
103
|
+
## 🤝 Contribuer
|
|
104
|
+
|
|
105
|
+
Les contributions sont les bienvenues ! Voici comment contribuer :
|
|
106
|
+
|
|
107
|
+
1. Forkez le projet
|
|
108
|
+
2. Créez une branche pour votre fonctionnalité (`git checkout -b feature/AmazingFeature`)
|
|
109
|
+
3. Committez vos changements (`git commit -m 'Add some AmazingFeature'`)
|
|
110
|
+
4. Poussez vers la branche (`git push origin feature/AmazingFeature`)
|
|
111
|
+
5. Ouvrez une Pull Request
|
|
112
|
+
|
|
113
|
+
## 📄 Licence
|
|
114
|
+
|
|
115
|
+
Distribué sous licence MIT. Voir le fichier `LICENSE` pour plus d'informations.
|
|
116
|
+
|
|
117
|
+
## 📞 Contact
|
|
118
|
+
|
|
119
|
+
Orssi Mp - [@OrssiMp](https://github.com/OrssiMp) - orssimpiere5@gmail.com
|
|
120
|
+
|
|
121
|
+
Lien du projet : [https://github.com/OrssiMp/chromalogger](https://github.com/OrssiMp/chromalogger)
|
|
17
122
|
|
|
18
123
|
// Couleurs de base
|
|
19
124
|
logger.red('Ceci est en rouge');
|
|
20
125
|
logger.green('Ceci est en vert');
|
|
21
126
|
logger.blue('Ceci est en bleu');
|
|
22
127
|
logger.yellow('Ceci est en jaune');
|
|
23
|
-
|
|
128
|
+
|
|
129
|
+
````
|
|
24
130
|
|
|
25
131
|
### Avec CommonJS
|
|
26
132
|
|
|
@@ -31,7 +137,7 @@ const logger = require('logcolor-js');
|
|
|
31
137
|
logger.bgRed(' Fond rouge ');
|
|
32
138
|
logger.bgGreen(' Fond vert ');
|
|
33
139
|
logger.bgBlue(' Fond bleu ');
|
|
34
|
-
|
|
140
|
+
````
|
|
35
141
|
|
|
36
142
|
## Fonctionnalités
|
|
37
143
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chromalogger",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "A colorful and flexible console logger for Node.js with CLI support",
|
|
5
5
|
"main": "chromalog.js",
|
|
6
6
|
"type": "module",
|
|
@@ -35,16 +35,16 @@
|
|
|
35
35
|
"author": {
|
|
36
36
|
"name": "Orssi Mp",
|
|
37
37
|
"email": "orssimpiere5@gmail.com",
|
|
38
|
-
"url": "https://github.com/
|
|
38
|
+
"url": "https://github.com/OrssiMp/chromalogger#readme"
|
|
39
39
|
},
|
|
40
40
|
"license": "MIT",
|
|
41
|
-
"homepage": "https://github.com/
|
|
41
|
+
"homepage": "https://github.com/OrssiMp/chromalogger#readme",
|
|
42
42
|
"repository": {
|
|
43
43
|
"type": "git",
|
|
44
|
-
"url": "git+https://github.com/
|
|
44
|
+
"url": "git+https://github.com/OrssiMp/chromalogger.git"
|
|
45
45
|
},
|
|
46
46
|
"bugs": {
|
|
47
|
-
"url": "https://github.com/
|
|
47
|
+
"url": "https://github.com/OrssiMp/chromalogger/issues"
|
|
48
48
|
},
|
|
49
49
|
"engines": {
|
|
50
50
|
"node": ">=12.0.0"
|