@cambo-khode/log 0.0.0-stage → 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.
@@ -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
+ }
@@ -0,0 +1,2 @@
1
+ export { MySDK } from './client.js';
2
+ export type { SDKConfig } from './types.js';
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ export { MySDK } from './client.js';
@@ -0,0 +1,5 @@
1
+ export interface SDKConfig {
2
+ appName?: string;
3
+ version?: string;
4
+ color?: 'red' | 'green' | 'yellow' | 'blue' | 'cyan' | 'white';
5
+ }
package/dist/types.js ADDED
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,19 @@
1
1
  {
2
2
  "name": "@cambo-khode/log",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "1.0.0",
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": ["dist"],
15
+ "scripts": {
16
+ "build": "tsc"
17
+ },
18
+ "license": "MIT"
6
19
  }
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.