Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@kitql/helper

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kitql/helper - npm Package Compare versions

Comparing version 0.1.3 to 0.1.4

22

index.js

@@ -5,6 +5,2 @@ 'use strict';

function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
const pino = _interopDefault(require('pino'));
function logGreen(str) {

@@ -23,22 +19,10 @@ return `\x1b[32m${str}\x1b[37m\x1b[0m`;

class Log {
constructor(toolName, options = null) {
const { sync = false, withTime = false, withlevelKey = true } = options !== null && options !== void 0 ? options : {};
constructor(toolName) {
this.toolName = toolName;
this.logger = pino({
transport: {
target: 'pino-pretty',
options: {
colorize: false,
sync,
translateTime: withTime ? true : false,
ignore: `pid,hostname${withTime ? '' : ',time'}${withlevelKey ? '' : ',level'}`
}
}
});
}
info(msg) {
this.logger.info(`${logMagneta(`[${this.toolName}]`)} - ${msg}`);
console.info(`${logMagneta(`[${this.toolName}]`)} ${msg}`);
}
error(msg) {
this.logger.error(`${logMagneta(`[${this.toolName}]`)} - ${msg}`);
console.error(`${logMagneta(`[${this.toolName}]`)}${logRed(`[E]`)} ${msg}`);
}

@@ -45,0 +29,0 @@ }

9

Log.d.ts

@@ -5,13 +5,8 @@ export declare function logGreen(str: string): string;

export declare function logCyan(str: string): string;
export declare type Options = {
sync?: boolean | null;
withTime?: boolean | null;
withlevelKey?: boolean | null;
};
export declare function logYellow(str: string): string;
export declare class Log {
private toolName;
private logger;
constructor(toolName: string, options?: Options | null);
constructor(toolName: string);
info(msg: string): void;
error(msg: string): void;
}
{
"name": "@kitql/helper",
"version": "0.1.3",
"dependencies": {
"pino": "7.8.0",
"pino-pretty": "7.5.1"
},
"version": "0.1.4",
"repository": {

@@ -9,0 +5,0 @@ "type": "git",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc