Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

boxt

omrilotan66kUnlicense1.1.2

📦 Create boxes around text

box, cli, title, message, 📦

readme

boxt

boxt

boxt

Use

npm i -S boxt

const boxt = require('boxt');

boxt(`I have a message
It might be multilined`);

Options

boxt(
    'Guests, like fish, begin to smell after three days.',
    {
        color: 'green',
        theme: 'round',
        padding: 4,
        align: 'center',
        minWidth: 100
    }
);
option meaning values
title A title And string
theme border style 'single' (default), 'double', 'round'
color border colour see chalk on NPM
padding space from borders to text
align Where to align the lines 'center' (default), 'left'/'start', 'right'/'end'
minWidth Minimal width any number or 'full' for full terminal width

Examples

options result
theme: 'double'
color: 'bgBlue'
example
theme: 'round'
color: 'green'
example
padding: 10
align: 'left'
example
title 'I am the title'.bold example

changelog

1.1.2

2022-01-09

  • Fix replace colors with chalk

1.1.1

2021-10-19

  • Fix in numeric minWidth calculation

1.1.0

2021-10-19

  • Add minWidth option