Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

bocks

1.0.0 • Public • Published

bocks v0.0.1

Tiny version of cli-boxes (only the rounded box).

Currently, this library has zero configuration.™ Pass a string, get it wrapped in a rounded box (with 1 space of horizontal padding). As minimal as it gets. Zero dependencies!

Just 470 bytes with gzip! It could be smaller, but the code is cute and ANSI support adds a few pounds.

const bocks = require('bocks')
 
console.log(bocks('hello world'))
// ╭─────────────╮
// │ hello world │
// ╰─────────────╯

NOTE: Multi-line boxes are not yet supported! (PRs accepted)

ANSI coloring

Painting the box with your favorite ANSI color library is easy! Try it with chalk.

const chalk = require('chalk')
 
let str = bocks(chalk.blue('hello world'))
str = str.replace(bocks.RE, chalk.red('$1'))
 
// See a beautiful red box with blue text! 😍
console.log(str)

Keywords

none

Install

npm i bocks

DownloadsWeekly Downloads

6

Version

1.0.0

License

none

Unpacked Size

3.06 kB

Total Files

5

Last publish

Collaborators

  • avatar