@cambo-khode/log 0.0.0-stage → 1.0.2
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/dist/client.d.ts +12 -0
- package/dist/client.js +40 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/types.d.ts +5 -0
- package/dist/types.js +1 -0
- package/package.json +19 -4
- package/README.md +0 -3
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SDKConfig } from './types.js';
|
|
2
|
+
export declare class MySDK {
|
|
3
|
+
private config;
|
|
4
|
+
private colors;
|
|
5
|
+
constructor(config?: SDKConfig);
|
|
6
|
+
private output;
|
|
7
|
+
log(message: string): void;
|
|
8
|
+
success(message: string): void;
|
|
9
|
+
error(message: string): void;
|
|
10
|
+
warning(message: string): void;
|
|
11
|
+
info(message: string): void;
|
|
12
|
+
}
|
package/dist/client.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export class MySDK {
|
|
2
|
+
config;
|
|
3
|
+
colors = {
|
|
4
|
+
red: '\x1b[31m',
|
|
5
|
+
green: '\x1b[32m',
|
|
6
|
+
yellow: '\x1b[33m',
|
|
7
|
+
blue: '\x1b[34m',
|
|
8
|
+
cyan: '\x1b[36m',
|
|
9
|
+
white: '\x1b[37m',
|
|
10
|
+
reset: '\x1b[0m'
|
|
11
|
+
};
|
|
12
|
+
constructor(config = {}) {
|
|
13
|
+
this.config = {
|
|
14
|
+
appName: 'My SDK',
|
|
15
|
+
version: '1.0.0',
|
|
16
|
+
color: 'cyan',
|
|
17
|
+
...config
|
|
18
|
+
};
|
|
19
|
+
this.info(`${this.config.appName} v${this.config.version} initialized`);
|
|
20
|
+
}
|
|
21
|
+
output(type, message, color) {
|
|
22
|
+
const time = new Date().toLocaleTimeString();
|
|
23
|
+
console.log(`${this.colors[color]}[${time}] [${type}] ${message}${this.colors.reset}`);
|
|
24
|
+
}
|
|
25
|
+
log(message) {
|
|
26
|
+
this.output('LOG', message, this.config.color);
|
|
27
|
+
}
|
|
28
|
+
success(message) {
|
|
29
|
+
this.output('SUCCESS', message, 'green');
|
|
30
|
+
}
|
|
31
|
+
error(message) {
|
|
32
|
+
this.output('ERROR', message, 'red');
|
|
33
|
+
}
|
|
34
|
+
warning(message) {
|
|
35
|
+
this.output('WARNING', message, 'yellow');
|
|
36
|
+
}
|
|
37
|
+
info(message) {
|
|
38
|
+
this.output('INFO', message, 'blue');
|
|
39
|
+
}
|
|
40
|
+
}
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { MySDK } from './client.js';
|
package/dist/types.d.ts
ADDED
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cambo-khode/log",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.2",
|
|
4
|
+
"description": "Cambo Khode custom console logger SDK",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist"
|
|
16
|
+
],
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "tsc"
|
|
19
|
+
},
|
|
20
|
+
"license": "MIT"
|
|
21
|
+
}
|
package/README.md
DELETED