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

@betterer/logger

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@betterer/logger - npm Package Compare versions

Comparing version 0.5.0 to 1.0.0

dist/types.d.ts

3

dist/index.d.ts

@@ -1,1 +0,2 @@

export * from './logger';
export { br, code, error, info, logo, overwrite, success, warn } from './logger';
export * from './types';
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
tslib_1.__exportStar(require("./logger"), exports);
var logger_1 = require("./logger");
exports.br = logger_1.br;
exports.code = logger_1.code;
exports.error = logger_1.error;
exports.info = logger_1.info;
exports.logo = logger_1.logo;
exports.overwrite = logger_1.overwrite;
exports.success = logger_1.success;
exports.warn = logger_1.warn;
//# sourceMappingURL=index.js.map

@@ -1,19 +0,9 @@

export declare function mute(): void;
export declare function header(head: string): void;
import { BettererLogger, BettererLoggerCodeInfo, BettererLoggerOverwriteDone } from './types';
export declare function logo(): void;
export declare function br(): void;
export declare const success: (...args: string[]) => void;
export declare const info: (...args: string[]) => void;
export declare const warn: (...args: string[]) => void;
export declare const error: (...args: string[]) => void;
export declare const code: (codeInfo: LoggerCodeInfo) => void;
export declare type LoggerCodeInfo = {
message: string;
filePath: string;
fileText: string;
start: number;
end: number;
};
export declare type LoggerCodeLocation = {
line: number;
column: number;
};
export declare const success: BettererLogger;
export declare const info: BettererLogger;
export declare const warn: BettererLogger;
export declare const error: BettererLogger;
export declare const code: (codeInfo: BettererLoggerCodeInfo) => void;
export declare function overwrite(content: string): BettererLoggerOverwriteDone;

@@ -5,14 +5,14 @@ "use strict";

var code_frame_1 = require("@babel/code-frame");
var chalk_1 = require("chalk");
var chalk = require("chalk");
var logUpdate = require("log-update");
var lines_and_columns_1 = require("lines-and-columns");
var path = require("path");
var ERROR_BLOCK = chalk.bgRed(' ');
var IS_JS_REGEXP = /.t|jsx?$/;
function mute() {
console['log'] = function () { };
var LOGO = chalk.yellowBright("\n \\ | / _ _ _ \n '-.ooo.-' | |__ ___| |_| |_ ___ _ __ ___ _ __ \n---ooooo--- | '_ \\ / _ \\ __| __/ _ \\ '__/ _ \\ '__|\n .-'ooo'-. | |_) | __/ |_| || __/ | | __/ | \n / | \\ |_.__/ \\___|\\__|\\__\\___|_| \\___|_| \n ");
var NEW_LINE = '\n';
function logo() {
console.log(LOGO);
}
exports.mute = mute;
function header(head) {
console.log(chalk_1.default.yellowBright(head));
}
exports.header = header;
exports.logo = logo;
function br() {

@@ -22,9 +22,9 @@ console.log('');

exports.br = br;
var HEADING = chalk_1.default.bgBlack.yellowBright.bold(" \u2600\uFE0F betterer ");
var HEADING = chalk.bgBlack.yellowBright.bold(" \u2600\uFE0F betterer ");
var previousLogger = 'LOG';
exports.success = createLogger(chalk_1.default.bgGreenBright.black(' succ '), chalk_1.default.bgBlack(' ✅ '));
exports.info = createLogger(chalk_1.default.bgWhiteBright.black(' info '), chalk_1.default.bgBlack(' 💬 '));
exports.warn = createLogger(chalk_1.default.bgYellowBright.black(' warn '), chalk_1.default.bgBlack(' ⚠️ '));
exports.error = createLogger(chalk_1.default.bgRedBright.white(' erro '), chalk_1.default.bgBlack(' 🔥 '));
var SPACER = chalk_1.default.bgBlack.yellowBright(' - ');
exports.success = createLogger(chalk.bgGreenBright.black(' succ '), chalk.bgBlack(' ✅ '));
exports.info = createLogger(chalk.bgWhiteBright.black(' info '), chalk.bgBlack(' 💬 '));
exports.warn = createLogger(chalk.bgYellowBright.black(' warn '), chalk.bgBlack(' ⚠️ '));
exports.error = createLogger(chalk.bgRedBright.white(' erro '), chalk.bgBlack(' 🔥 '));
var SPACER = chalk.bgBlack.yellowBright(' - ');
function createLogger(name, icon) {

@@ -39,3 +39,3 @@ return function () {

}
console.log.apply(console, tslib_1.__spreadArrays(["" + HEADING + name + icon + SPACER], messages.map(function (m) { return chalk_1.default.whiteBright(m); })));
console.log.apply(console, tslib_1.__spreadArrays(["" + HEADING + name + icon + SPACER], messages.map(function (m) { return chalk.whiteBright(m); })));
previousLogger = 'LOG';

@@ -62,5 +62,11 @@ };

var codeFrame = code_frame_1.codeFrameColumns(fileText, { start: start, end: end }, options);
console.log("\n" + chalk_1.default.bgRed(' ') + chalk_1.default.bgBlack.white(" " + message + " \n") + codeFrame);
var codeMessage = chalk.bgBlack.white(" " + message + " " + NEW_LINE);
console.log("" + NEW_LINE + ERROR_BLOCK + codeMessage + codeFrame);
previousLogger = 'CODE';
};
function overwrite(content) {
logUpdate("" + LOGO + NEW_LINE + content);
return logUpdate.done.bind(logUpdate);
}
exports.overwrite = overwrite;
//# sourceMappingURL=logger.js.map
{
"name": "@betterer/logger",
"description": "logger for @betterer/betterer",
"version": "0.5.0",
"version": "1.0.0",
"license": "MIT",

@@ -28,4 +28,5 @@ "publishConfig": {

"@babel/code-frame": "^7.5.5",
"chalk": "^2.4.2",
"chalk": "^4.0.0",
"lines-and-columns": "^1.1.6",
"log-update": "^4.0.0",
"npmlog": "^4.1.2",

@@ -38,3 +39,3 @@ "tslib": "^1.10.0"

},
"gitHead": "34f5170cce39e8dd684158066243d36b9e27aeb6"
"gitHead": "1ce8729fb53a9a138624c2d30282092bbe931ddf"
}

@@ -1,2 +0,2 @@

[![betterer](https://github.com/phenomnomnominal/betterer/blob/master/docs/logo.png)](https://phenomnomnominal.github.io/betterer/)
[![Betterer](https://raw.githubusercontent.com/phenomnomnominal/betterer/master/docs/logo.png)](https://phenomnomnominal.github.io/betterer/)

@@ -7,3 +7,3 @@ # `@betterer/logger`

Logger used within [**`betterer`**](https://github.com/phenomnomnominal/betterer).
Logger used within [**`Betterer`**](https://github.com/phenomnomnominal/betterer).

@@ -44,2 +44,4 @@ ## Usage

```typescript
import { info } from '@betterer/logger';
info('message');

@@ -55,2 +57,4 @@ ```

```typescript
import { success } from '@betterer/logger';
success('message');

@@ -66,2 +70,4 @@ ```

```typescript
import { warn } from '@betterer/logger';
warn('message');

@@ -68,0 +74,0 @@ ```

Sorry, the diff of this file is not supported yet

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