0.0.1 • Published 1 year ago

teeti v0.0.1

Weekly downloads
-
License
-
Repository
github
Last release
1 year ago

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 │
│             │
└─────────────┘
*/
0.0.1

1 year ago

0.0.0

1 year ago