Socket
Socket
Sign inDemoInstall

@rushstack/terminal

Package Overview
Dependencies
Maintainers
3
Versions
311
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rushstack/terminal - npm Package Compare versions

Comparing version 0.7.6 to 0.7.7

38

lib/PrintUtilities.js

@@ -106,14 +106,34 @@ "use strict";

const wrappedMessageLines = PrintUtilities.wrapWordsToLines(message, maxLineLength);
// ╔═══════════╗
// ║ Message ║
// ╚═══════════╝
terminal.writeLine(` ╔${'═'.repeat(boxWidth - 2)}╗ `);
let longestLineLength = 0;
const trimmedLines = [];
for (const line of wrappedMessageLines) {
const trimmedLine = line.trim();
const padding = boxWidth - trimmedLine.length - 2;
const leftPadding = Math.floor(padding / 2);
const rightPadding = padding - leftPadding;
terminal.writeLine(` ║${' '.repeat(leftPadding)}${trimmedLine}${' '.repeat(rightPadding)}║ `);
trimmedLines.push(trimmedLine);
longestLineLength = Math.max(longestLineLength, trimmedLine.length);
}
terminal.writeLine(` ╚${'═'.repeat(boxWidth - 2)}╝ `);
if (longestLineLength > boxWidth - 2) {
// If the longest line is longer than the box, print bars above and below the message
// ═════════════
// Message
// ═════════════
const headerAndFooter = ` ${'═'.repeat(boxWidth)}`;
terminal.writeLine(headerAndFooter);
for (const line of wrappedMessageLines) {
terminal.writeLine(` ${line}`);
}
terminal.writeLine(headerAndFooter);
}
else {
// ╔═══════════╗
// ║ Message ║
// ╚═══════════╝
terminal.writeLine(` ╔${'═'.repeat(boxWidth - 2)}╗`);
for (const trimmedLine of trimmedLines) {
const padding = boxWidth - trimmedLine.length - 2;
const leftPadding = Math.floor(padding / 2);
const rightPadding = padding - leftPadding;
terminal.writeLine(` ║${' '.repeat(leftPadding)}${trimmedLine}${' '.repeat(rightPadding)}║`);
}
terminal.writeLine(` ╚${'═'.repeat(boxWidth - 2)}╝`);
}
}

@@ -120,0 +140,0 @@ }

{
"name": "@rushstack/terminal",
"version": "0.7.6",
"version": "0.7.7",
"description": "User interface primitives for console applications",

@@ -14,7 +14,7 @@ "main": "lib/index.js",

"dependencies": {
"@rushstack/node-core-library": "3.60.1"
"@rushstack/node-core-library": "3.61.0"
},
"devDependencies": {
"colors": "~1.2.1",
"@rushstack/heft": "0.62.0",
"@rushstack/heft": "0.62.1",
"local-node-rig": "1.0.0"

@@ -21,0 +21,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