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

friendly-errors-webpack-plugin

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

friendly-errors-webpack-plugin - npm Package Compare versions

Comparing version 1.2.0 to 1.3.0

5

package.json
{
"name": "friendly-errors-webpack-plugin",
"version": "1.2.0",
"version": "1.3.0",
"description": "",

@@ -44,4 +44,5 @@ "main": "index.js",

"chalk": "^1.1.3",
"error-stack-parser": "^2.0.0"
"error-stack-parser": "^2.0.0",
"string-length": "^1.0.1"
}
}

29

src/output.js

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

const chalk = require('chalk');
const stringLength = require('string-length');
const readline = require('readline');

@@ -52,5 +54,22 @@ class Debugger {

if (this.enabled) {
const date = new Date();
const dateString = chalk.grey(date.toLocaleTimeString());
const titleFormatted = colors.formatTitle(severity, title);
const subTitleFormatted = colors.formatText(severity, subtitle);
this.log(titleFormatted, subTitleFormatted);
const message = `${titleFormatted} ${subTitleFormatted}`
// In test environment we don't include timestamp
if(process.env.NODE_ENV === 'test') {
this.log(message);
this.log();
return;
}
// Make timestamp appear at the end of the line
let logSpace = process.stdout.columns - stringLength(message) - stringLength(dateString)
if (logSpace <= 0) {
logSpace = 10
}
this.log(`${message}${' '.repeat(logSpace)}${dateString}`);
this.log();

@@ -61,4 +80,8 @@ }

clearConsole () {
if (!this.capturing && this.enabled) {
process.stdout.write('\x1bc');
if (!this.capturing && this.enabled && process.stdout.isTTY) {
// Fill screen with blank lines. Then move to 0 (beginning of visible part) and clear it
const blank = '\n'.repeat(process.stdout.rows)
console.log(blank)
readline.cursorTo(process.stdout, 0, 0)
readline.clearScreenDown(process.stdout)
}

@@ -65,0 +88,0 @@ }

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