@kitql/helper
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -1,1 +0,2 @@ | ||
export type { Log, logGreen, logCyan, logRed } from './Log'; | ||
export { type Logger } from 'pino'; | ||
export { Log, logCyan, logGreen, logRed } from './Log'; |
39
index.js
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } | ||
const pino = _interopDefault(require('pino')); | ||
function logGreen(str) { | ||
return `\x1b[32m${str}\x1b[37m\x1b[0m`; | ||
} | ||
function logRed(str) { | ||
return `\u001B[31m${str}\x1b[37m\x1b[0m`; | ||
} | ||
function logCyan(str) { | ||
return `\x1b[36m${str}\x1b[37m\x1b[0m`; | ||
} | ||
class Log { | ||
constructor(toolName) { | ||
this.toolName = toolName; | ||
this.logger = pino({ | ||
transport: { | ||
target: 'pino-pretty', | ||
options: { | ||
colorize: true | ||
} | ||
} | ||
}); | ||
} | ||
info(msg) { | ||
this.logger.info(`[${this.toolName}] - ${msg}`); | ||
} | ||
error(msg) { | ||
this.logger.error(`[${this.toolName}] - ${msg}`); | ||
} | ||
} | ||
exports.Log = Log; | ||
exports.logCyan = logCyan; | ||
exports.logGreen = logGreen; | ||
exports.logRed = logRed; |
{ | ||
"name": "@kitql/helper", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"dependencies": { | ||
@@ -14,2 +14,5 @@ "pino": "7.6.5", | ||
"license": "MIT", | ||
"engines": { | ||
"node": "17.4.0" | ||
}, | ||
"main": "index.js", | ||
@@ -16,0 +19,0 @@ "module": "index.mjs", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2783
78