advanced-logs
Advanced tools
Comparing version 2.0.1 to 2.1.0
@@ -1,10 +0,1 @@ | ||
declare global { | ||
interface Console { | ||
success(message: string, title?: string): void; | ||
error(message: string, title?: string): void; | ||
info(message: string, title?: string): void; | ||
warn(message: string, title?: string): void; | ||
debug(message: string, title?: string): void; | ||
} | ||
} | ||
export {}; | ||
export * from '../src/lib/logger'; |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const colors_1 = require("./utils/colors"); | ||
; | ||
const success = function (message, title) { | ||
const getHours = new Date().getHours().toString().padStart(2, '0'); | ||
const getMinutes = new Date().getMinutes().toString().padStart(2, '0'); | ||
const getSeconds = new Date().getSeconds().toString().padStart(2, '0'); | ||
title = title || 'SUCCESS'; | ||
console.log(`${colors_1.Colors.fg.black}${colors_1.Colors.bright}${getHours}:${getMinutes}:${getSeconds} ${colors_1.Colors.fg.green}${colors_1.Colors.bright}${title} ${colors_1.Colors.reset}${message}`); | ||
}; | ||
const error = function (message, title) { | ||
const getHours = new Date().getHours().toString().padStart(2, '0'); | ||
const getMinutes = new Date().getMinutes().toString().padStart(2, '0'); | ||
const getSeconds = new Date().getSeconds().toString().padStart(2, '0'); | ||
title = title || 'ERROR'; | ||
console.log(`${colors_1.Colors.fg.black}${colors_1.Colors.bright}${getHours}:${getMinutes}:${getSeconds} ${colors_1.Colors.fg.red}${colors_1.Colors.bright}${title} ${colors_1.Colors.reset}${message}`); | ||
}; | ||
const info = function (message, title) { | ||
const getHours = new Date().getHours().toString().padStart(2, '0'); | ||
const getMinutes = new Date().getMinutes().toString().padStart(2, '0'); | ||
const getSeconds = new Date().getSeconds().toString().padStart(2, '0'); | ||
title = title || 'INFO'; | ||
console.log(`${colors_1.Colors.fg.black}${colors_1.Colors.bright}${getHours}:${getMinutes}:${getSeconds} ${colors_1.Colors.fg.cyan}${colors_1.Colors.bright}${title} ${colors_1.Colors.reset}${message}`); | ||
}; | ||
const warn = function (message, title) { | ||
const getHours = new Date().getHours().toString().padStart(2, '0'); | ||
const getMinutes = new Date().getMinutes().toString().padStart(2, '0'); | ||
const getSeconds = new Date().getSeconds().toString().padStart(2, '0'); | ||
title = title || 'WARN'; | ||
console.log(`${colors_1.Colors.fg.black}${colors_1.Colors.bright}${getHours}:${getMinutes}:${getSeconds} ${colors_1.Colors.fg.yellow}${colors_1.Colors.bright}${title} ${colors_1.Colors.reset}${message}`); | ||
}; | ||
const debug = function (message, title) { | ||
const getHours = new Date().getHours().toString().padStart(2, '0'); | ||
const getMinutes = new Date().getMinutes().toString().padStart(2, '0'); | ||
const getSeconds = new Date().getSeconds().toString().padStart(2, '0'); | ||
title = title || 'DEBUG'; | ||
console.log(`${colors_1.Colors.fg.black}${colors_1.Colors.bright}${getHours}:${getMinutes}:${getSeconds} ${colors_1.Colors.fg.blue}${colors_1.Colors.bright}${title} ${colors_1.Colors.reset}${message}`); | ||
}; | ||
console.success = success; | ||
console.error = error; | ||
console.info = info; | ||
console.warn = warn; | ||
console.debug = debug; | ||
__exportStar(require("../src/lib/logger"), exports); |
{ | ||
"name": "advanced-logs", | ||
"version": "2.0.1", | ||
"version": "2.1.0", | ||
"description": "Beautify and modernize console messages.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -15,2 +15,12 @@ ![npm](https://img.shields.io/npm/v/advanced-logs?label=npm&style=for-the-badge) | ||
```js | ||
require('advanced-logs'); // CJS | ||
import 'advanced-logs'; // ESM | ||
console.setConfig({ | ||
background: true, | ||
timestamp: false | ||
}); // new | opitonal | ||
console.getConfig(); // new | optional | ||
console.success("Success"); | ||
@@ -17,0 +27,0 @@ console.info("Info"); |
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
Unpublished package
Supply chain riskPackage version was not found on the registry. It may exist on a different registry and need to be configured to pull from that registry.
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
Unpopular package
QualityThis package is not very popular.
Found 1 instance in 1 package
11938
14
204
0
60
1