cloggi 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 +25 -0
- package/dist/index.js +77 -0
- package/package.json +27 -0
package/README.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# cloggi
|
|
2
|
+
|
|
3
|
+
## Installation
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm install cloggi
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
import { cloggi } from 'cloggi';
|
|
13
|
+
|
|
14
|
+
cloggi.bold('This is bold text');
|
|
15
|
+
cloggi.italic('This is italic text');
|
|
16
|
+
cloggi.underline('This is underlined text');
|
|
17
|
+
cloggi.strikethrough('This is strikethrough text');
|
|
18
|
+
cloggi.red('This is red text');
|
|
19
|
+
cloggi.green('This is green text');
|
|
20
|
+
cloggi.blue('This is blue text');
|
|
21
|
+
cloggi.log('This is plain text');
|
|
22
|
+
|
|
23
|
+
// Or mix them up
|
|
24
|
+
cloggi.red.bold('This is bold red text');
|
|
25
|
+
```
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { styleText as st } from 'node:util';
|
|
2
|
+
class ClogBuilder {
|
|
3
|
+
constructor() {
|
|
4
|
+
this._color = 'white';
|
|
5
|
+
this._modifier = 'reset';
|
|
6
|
+
}
|
|
7
|
+
_print(text) {
|
|
8
|
+
console.log(st([this._color, this._modifier], text));
|
|
9
|
+
this._color = 'white';
|
|
10
|
+
this._modifier = 'reset';
|
|
11
|
+
return this;
|
|
12
|
+
}
|
|
13
|
+
get red() {
|
|
14
|
+
this._color = 'red';
|
|
15
|
+
return this;
|
|
16
|
+
}
|
|
17
|
+
get green() {
|
|
18
|
+
this._color = 'green';
|
|
19
|
+
return this;
|
|
20
|
+
}
|
|
21
|
+
get yellow() {
|
|
22
|
+
this._color = 'yellow';
|
|
23
|
+
return this;
|
|
24
|
+
}
|
|
25
|
+
get blue() {
|
|
26
|
+
this._color = 'blue';
|
|
27
|
+
return this;
|
|
28
|
+
}
|
|
29
|
+
get magenta() {
|
|
30
|
+
this._color = 'magenta';
|
|
31
|
+
return this;
|
|
32
|
+
}
|
|
33
|
+
get cyan() {
|
|
34
|
+
this._color = 'cyan';
|
|
35
|
+
return this;
|
|
36
|
+
}
|
|
37
|
+
get white() {
|
|
38
|
+
this._color = 'white';
|
|
39
|
+
return this;
|
|
40
|
+
}
|
|
41
|
+
bold(text) {
|
|
42
|
+
this._modifier = 'bold';
|
|
43
|
+
return this._print(text);
|
|
44
|
+
}
|
|
45
|
+
italic(text) {
|
|
46
|
+
this._modifier = 'italic';
|
|
47
|
+
return this._print(text);
|
|
48
|
+
}
|
|
49
|
+
underline(text) {
|
|
50
|
+
this._modifier = 'underline';
|
|
51
|
+
return this._print(text);
|
|
52
|
+
}
|
|
53
|
+
strikethrough(text) {
|
|
54
|
+
this._modifier = 'strikethrough';
|
|
55
|
+
return this._print(text);
|
|
56
|
+
}
|
|
57
|
+
dim(text) {
|
|
58
|
+
this._modifier = 'dim';
|
|
59
|
+
return this._print(text);
|
|
60
|
+
}
|
|
61
|
+
blink(text) {
|
|
62
|
+
this._modifier = 'blink';
|
|
63
|
+
return this._print(text);
|
|
64
|
+
}
|
|
65
|
+
inverse(text) {
|
|
66
|
+
this._modifier = 'inverse';
|
|
67
|
+
return this._print(text);
|
|
68
|
+
}
|
|
69
|
+
hidden(text) {
|
|
70
|
+
this._modifier = 'hidden';
|
|
71
|
+
return this._print(text);
|
|
72
|
+
}
|
|
73
|
+
log(text) {
|
|
74
|
+
return this._print(text);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
export const cloggi = new ClogBuilder();
|
package/package.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "cloggi",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"author": "Claudio Santancini",
|
|
5
|
+
"description": "cloggish!",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "tsc && tsc-alias",
|
|
9
|
+
"start": "node dist/index.js",
|
|
10
|
+
"dev": "tsc && tsc-alias && npm start"
|
|
11
|
+
},
|
|
12
|
+
"keywords": [
|
|
13
|
+
"console",
|
|
14
|
+
"log"
|
|
15
|
+
],
|
|
16
|
+
"license": "CC BY-NC 4.0",
|
|
17
|
+
"type": "module",
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@types/node": "^25.3.0",
|
|
20
|
+
"tsc-alias": "^1.8.16",
|
|
21
|
+
"typescript": "^5.9.3"
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"dist/**/*"
|
|
25
|
+
],
|
|
26
|
+
"types": "dist/index.d.ts"
|
|
27
|
+
}
|