Comparing version 1.0.0 to 1.1.0
@@ -61,2 +61,3 @@ const colors = require('colors'); | ||
align = ALIGN, | ||
minWidth = 0, | ||
title, | ||
@@ -73,3 +74,6 @@ } = {}) { | ||
const lines = message.split('\n'); | ||
const width = maxLength(title, ...message.split('\n')); | ||
const width = minWidth === 'full' | ||
? process.stdout.columns - 2 - padding * 2 | ||
: Math.max(Number(minWidth), maxLength(title, ...message.split('\n'))) | ||
; | ||
const space = width + padding * 2; | ||
@@ -76,0 +80,0 @@ const times = (string = ' ', length = space) => arrayOf(string, length); |
{ | ||
"name": "boxt", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "📦 Create boxes around text", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -25,2 +25,4 @@ # boxt [](https://www.npmjs.com/package/boxt) [](https://github.com/omrilotan/mono/tree/master/packages/boxt) | ||
padding: 4, | ||
align: 'center', | ||
minWidth: 100 | ||
} | ||
@@ -37,2 +39,3 @@ ); | ||
| align | Where to align the lines | 'center' (default), 'left'/'start', 'right'/'end' | ||
| minWidth | Minimal width | any number or 'full' for full terminal width | ||
@@ -39,0 +42,0 @@ ## Examples |
9493
9
215
48