Dismiss
  • Scroll up
  • Toggle Theme
  • View as Mobile

@davidwells/box-logger

@davidwells/box-logger creates formatted terminal boxes, headers, horizontal lines, and multi-column layouts for CLI output.

It is small UI infrastructure for command-line tools: make important output easier to scan without forcing every script to rebuild terminal formatting from scratch.

Why it matters

Readable terminal output changes how quickly people can understand a tool. Clear headers, status boxes, and dividers make CLI workflows easier to debug, document, and reuse.

What it includes

  • Boxes with configurable borders, padding, alignment, colors, and width constraints.
  • Header helpers for success, error, warning, and info output.
  • Horizontal rules with optional labels.
  • Stacked and horizontal box layouts.
  • Dynamic and async content functions that receive layout width.
  • ASCII fallbacks and multiple border styles for different terminal environments.

Install

npm install @davidwells/box-logger

Example

const { makeBox, logHeader } = require('@davidwells/box-logger')

logHeader.success('Deploy complete')

console.log(makeBox({
  title: 'Build summary',
  content: 'All packages passed',
  borderStyle: 'rounded',
  borderColor: 'green'
}))