puppylog 1.0.5 → 1.2.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 +3 -0
- package/package.json +2 -1
- package/src/index.d.ts +84 -0
- package/src/index.js +36 -2
- package/.gitattributes +0 -2
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "puppylog",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Coloured logging, ported to npm. Another useless file taken out of my projects!",
|
|
5
5
|
"type": "module",
|
|
6
|
+
"types": "./index.d.ts",
|
|
6
7
|
"main": "./src/index.js",
|
|
7
8
|
"exports": {
|
|
8
9
|
".": "./src/index.js"
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
export type LogFn = (...args: any[]) => void;
|
|
2
|
+
|
|
3
|
+
export interface PuppyLog {
|
|
4
|
+
green: LogFn;
|
|
5
|
+
red: LogFn;
|
|
6
|
+
yellow: LogFn;
|
|
7
|
+
blue: LogFn;
|
|
8
|
+
cyan: LogFn;
|
|
9
|
+
magenta: LogFn;
|
|
10
|
+
white: LogFn;
|
|
11
|
+
gray: LogFn;
|
|
12
|
+
black: LogFn;
|
|
13
|
+
pink: LogFn;
|
|
14
|
+
orange: LogFn;
|
|
15
|
+
purple: LogFn;
|
|
16
|
+
brown: LogFn;
|
|
17
|
+
beige: LogFn;
|
|
18
|
+
|
|
19
|
+
bgGreen: LogFn;
|
|
20
|
+
bgRed: LogFn;
|
|
21
|
+
bgYellow: LogFn;
|
|
22
|
+
bgBlue: LogFn;
|
|
23
|
+
bgCyan: LogFn;
|
|
24
|
+
bgMagenta: LogFn;
|
|
25
|
+
bgWhite: LogFn;
|
|
26
|
+
bgGray: LogFn;
|
|
27
|
+
bgBlack: LogFn;
|
|
28
|
+
bgPink: LogFn;
|
|
29
|
+
bgOrange: LogFn;
|
|
30
|
+
bgPurple: LogFn;
|
|
31
|
+
bgBrown: LogFn;
|
|
32
|
+
bgBeige: LogFn;
|
|
33
|
+
|
|
34
|
+
boldGreen: LogFn;
|
|
35
|
+
boldRed: LogFn;
|
|
36
|
+
boldYellow: LogFn;
|
|
37
|
+
boldBlue: LogFn;
|
|
38
|
+
boldCyan: LogFn;
|
|
39
|
+
boldMagenta: LogFn;
|
|
40
|
+
boldWhite: LogFn;
|
|
41
|
+
boldGray: LogFn;
|
|
42
|
+
boldBlack: LogFn;
|
|
43
|
+
boldPink: LogFn;
|
|
44
|
+
boldOrange: LogFn;
|
|
45
|
+
boldPurple: LogFn;
|
|
46
|
+
boldBrown: LogFn;
|
|
47
|
+
boldBeige: LogFn;
|
|
48
|
+
|
|
49
|
+
italicGreen: LogFn;
|
|
50
|
+
italicRed: LogFn;
|
|
51
|
+
italicYellow: LogFn;
|
|
52
|
+
italicBlue: LogFn;
|
|
53
|
+
italicCyan: LogFn;
|
|
54
|
+
italicMagenta: LogFn;
|
|
55
|
+
italicWhite: LogFn;
|
|
56
|
+
italicGray: LogFn;
|
|
57
|
+
italicBlack: LogFn;
|
|
58
|
+
italicPink: LogFn;
|
|
59
|
+
italicOrange: LogFn;
|
|
60
|
+
italicPurple: LogFn;
|
|
61
|
+
italicBrown: LogFn;
|
|
62
|
+
italicBeige: LogFn;
|
|
63
|
+
|
|
64
|
+
bold: LogFn;
|
|
65
|
+
italic: LogFn;
|
|
66
|
+
underline: LogFn;
|
|
67
|
+
strikethrough: LogFn;
|
|
68
|
+
dim: LogFn;
|
|
69
|
+
|
|
70
|
+
success: LogFn;
|
|
71
|
+
error: LogFn;
|
|
72
|
+
warning: LogFn;
|
|
73
|
+
info: LogFn;
|
|
74
|
+
highlight: LogFn;
|
|
75
|
+
muted: LogFn;
|
|
76
|
+
special: LogFn;
|
|
77
|
+
|
|
78
|
+
custom(message: string, color: string): void;
|
|
79
|
+
customBg(message: string, color: string): void;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export const log: PuppyLog;
|
|
83
|
+
|
|
84
|
+
export default log;
|
package/src/index.js
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Logging helpers built on top of chalk.
|
|
5
|
+
* All methods print directly to stdout.
|
|
6
|
+
*/
|
|
3
7
|
export const log = {
|
|
4
8
|
green: (...args) => console.log(chalk.green(...args)),
|
|
5
9
|
red: (...args) => console.log(chalk.red(...args)),
|
|
@@ -31,6 +35,36 @@ export const log = {
|
|
|
31
35
|
bgBrown: (...args) => console.log(chalk.bgHex('#A52A2A')(...args)),
|
|
32
36
|
bgBeige: (...args) => console.log(chalk.bgHex('#F5F5DC')(...args)),
|
|
33
37
|
|
|
38
|
+
boldGreen: (...args) => console.log(chalk.green.bold(...args)),
|
|
39
|
+
boldRed: (...args) => console.log(chalk.red.bold(...args)),
|
|
40
|
+
boldYellow: (...args) => console.log(chalk.yellow.bold(...args)),
|
|
41
|
+
boldBlue: (...args) => console.log(chalk.blue.bold(...args)),
|
|
42
|
+
boldCyan: (...args) => console.log(chalk.cyan.bold(...args)),
|
|
43
|
+
boldMagenta: (...args) => console.log(chalk.magenta.bold(...args)),
|
|
44
|
+
boldWhite: (...args) => console.log(chalk.white.bold(...args)),
|
|
45
|
+
boldGray: (...args) => console.log(chalk.gray.bold(...args)),
|
|
46
|
+
boldBlack: (...args) => console.log(chalk.black.bold(...args)),
|
|
47
|
+
boldPink: (...args) => console.log(chalk.hex('#FFC0CB').bold(...args)),
|
|
48
|
+
boldOrange: (...args) => console.log(chalk.hex('#FFA500').bold(...args)),
|
|
49
|
+
boldPurple: (...args) => console.log(chalk.hex('#800080').bold(...args)),
|
|
50
|
+
boldBrown: (...args) => console.log(chalk.hex('#A52A2A').bold(...args)),
|
|
51
|
+
boldBeige: (...args) => console.log(chalk.hex('#F5F5DC').bold(...args)),
|
|
52
|
+
|
|
53
|
+
italicGreen: (...args) => console.log(chalk.green.italic(...args)),
|
|
54
|
+
italicRed: (...args) => console.log(chalk.red.italic(...args)),
|
|
55
|
+
italicYellow: (...args) => console.log(chalk.yellow.italic(...args)),
|
|
56
|
+
italicBlue: (...args) => console.log(chalk.blue.italic(...args)),
|
|
57
|
+
italicCyan: (...args) => console.log(chalk.cyan.italic(...args)),
|
|
58
|
+
italicMagenta: (...args) => console.log(chalk.magenta.italic(...args)),
|
|
59
|
+
italicWhite: (...args) => console.log(chalk.white.italic(...args)),
|
|
60
|
+
italicGray: (...args) => console.log(chalk.gray.italic(...args)),
|
|
61
|
+
italicBlack: (...args) => console.log(chalk.black.italic(...args)),
|
|
62
|
+
italicPink: (...args) => console.log(chalk.hex('#FFC0CB').italic(...args)),
|
|
63
|
+
italicOrange: (...args) => console.log(chalk.hex('#FFA500').italic(...args)),
|
|
64
|
+
italicPurple: (...args) => console.log(chalk.hex('#800080').italic(...args)),
|
|
65
|
+
italicBrown: (...args) => console.log(chalk.hex('#A52A2A').italic(...args)),
|
|
66
|
+
italicBeige: (...args) => console.log(chalk.hex('#F5F5DC').italic(...args)),
|
|
67
|
+
|
|
34
68
|
bold: (...args) => console.log(chalk.bold(...args)),
|
|
35
69
|
italic: (...args) => console.log(chalk.italic(...args)),
|
|
36
70
|
underline: (...args) => console.log(chalk.underline(...args)),
|
|
@@ -45,8 +79,8 @@ export const log = {
|
|
|
45
79
|
muted: (...args) => console.log(chalk.gray.italic(...args)),
|
|
46
80
|
special: (...args) => console.log(chalk.cyan.underline(...args)),
|
|
47
81
|
|
|
48
|
-
custom: (message, color) => console.log(chalk[color](message)),
|
|
49
|
-
customBg: (message, color) => console.log(chalk
|
|
82
|
+
custom: (message, color) => console.log((chalk[color])(message)),
|
|
83
|
+
customBg: (message, color) => console.log((chalk[`bg${color}`])(message))
|
|
50
84
|
};
|
|
51
85
|
|
|
52
86
|
export default log;
|
package/.gitattributes
DELETED