ssh-tunneling
Advanced tools
Comparing version 1.1.7 to 1.1.8
type Color = 'success' | 'error' | 'info' | 'warn' | 'white' | 'bgWhite' | 'cyan' | 'bgCyan' | 'black' | 'bgBlack' | 'red' | 'bgRed' | 'purple' | 'bgPurple' | 'blue' | 'bgBlue' | 'pink' | 'bgPink' | 'green' | 'bgGreen' | 'yellow' | 'bgYellow' | 'orange' | 'bgOrange' | 'gray' | 'bgGray' | 'mint' | 'bgMint'; | ||
type ChainLogger = Record<Color, (content: any) => ChainLogger> & { | ||
endLine: () => void; | ||
}; | ||
type Logger = Record<Color, (content: any, options?: { | ||
@@ -10,2 +13,3 @@ newLine?: boolean; | ||
}[]) => void; | ||
startLine: () => ChainLogger; | ||
lineGradient: (content: string) => void; | ||
@@ -12,0 +16,0 @@ }; |
@@ -103,2 +103,23 @@ "use strict"; | ||
}, | ||
startLine() { | ||
const newLogger = { | ||
...Object.entries(config).reduce((pre, [type, config]) => { | ||
const [fontColor, bgColor] = config; | ||
pre[type] = (content) => { | ||
colorOutput({ | ||
fontColor: fontColor || undefined, | ||
bgColor: bgColor || undefined, | ||
newLine: false, | ||
content | ||
}); | ||
return newLogger; | ||
}; | ||
return pre; | ||
}, {}), | ||
endLine() { | ||
console.log(''); | ||
} | ||
}; | ||
return newLogger; | ||
}, | ||
lineGradient(content) { | ||
@@ -185,2 +206,3 @@ const lines = content.split('\n'); | ||
// `); | ||
// logger.startLine().success('a').bgBlue(1).endLine(); | ||
exports.default = logger; |
{ | ||
"private": false, | ||
"name": "ssh-tunneling", | ||
"version": "1.1.7", | ||
"version": "1.1.8", | ||
"description": "a ssh-tunneling client for nodejs", | ||
@@ -6,0 +6,0 @@ "keywords": [ |
41119
786