boxen

Create boxes in the terminal for CLI output and status messages.

boxen

General JS

Create boxes in the terminal for CLI output and status messages.

Fit

Bundle (gzip)

12.0 kB

45.2 kB raw

Install size includes transitive dependencies. Bundle size is gzipped browser payload.

Freshness

The Problem

Terminal apps often need a way to highlight warnings, success messages, or notes without relying on plain text, but manually drawing borders and padding in the terminal is tedious and error-prone.

What It Does

boxen wraps text in a styled box with padding, margin, border styles, and colors. It makes CLI message formatting simple, so output looks polished with minimal code.

Installation

bash
npm install boxen

Usage Example

js
import boxen from "boxen";

const message = boxen("Deployment complete", {
  padding: 1,
  margin: 1,
  borderStyle: "round",
  borderColor: "green",
});

console.log(message);

Related packages