teeti
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

teeti

Box for nodejs

   ┌───────────────────── notice ──────────────────────┐
   │                                                   │
   │                    Hello World                    │
   │                                                   │
   └───────────────────────────────────────────────────┘

Installation

npm install teeti

Usage

const { box } = require('teeti');

console.log(box('Hello World'));
/*
┌───────────┐
│Hello World│
└───────────┘
*/
console.log(box('Hello World', { title: 'abc' }));
/*
┌────abc────┐
│Hello World│
└───────────┘
*/

Options

title

  • type: string

titlePadding

  • type: number
console.log(box('Hello World', { title: 'abc', titlePadding: 1 }));
/*
┌─── abc ───┐
│Hello World│
└───────────┘
*/

titleAlign

  • type: string
  • default: center
- left
┌abc────────┐
│Hello World│
└───────────┘
- center
┌────abc────┐
│Hello World│
└───────────┘
- right
┌────────abc┐
│Hello World│
└───────────┘

textAlign

  • type: string
  • default: left
console.log(box('Hello World', { textAlign: 'left', minWidth: 25 }));
console.log(box('Hello World', { textAlign: 'center', minWidth: 25 }));
console.log(box('Hello World', { textAlign: 'right', minWidth: 25 }));

/*
┌───────────────────────┐
│Hello World            │
└───────────────────────┘
┌───────────────────────┐
│      Hello World      │
└───────────────────────┘
┌───────────────────────┐
│            Hello World│
└───────────────────────┘
*/

padding

  • type: number
console.log(box('Hello World', { padding: 1 }));

/*
┌─────────────┐
│             │
│ Hello World │
│             │
└─────────────┘
*/

Readme

Keywords

Package Sidebar

Install

npm i teeti

Weekly Downloads

1

Version

0.0.1

License

none

Unpacked Size

9.43 kB

Total Files

6

Last publish

Collaborators

  • do4ng