This package has been deprecated

Author message:

Package no longer supported. Contact support@npmjs.com for more info.

tuck

0.0.4 • Public • Published
                                      ~ tuck ~
                           ┌─────────────────────────────┐
                           │  tuck your text into a box  │
                           └─────────────────────────────┘

Install

$ npm install --save tuck

Usage

var tuck = require("tuck");

console.log(tuck(["Hi There", "This is how we tuck text into a box"]));
output
┌─────────────────────────────────────┐
│              Hi There               │
│ This is how we tuck text into a box │
└─────────────────────────────────────┘
You can also configure the output:
var tuck = require("tuck");

console.log(tuck([

    "",
    "Hello",
    "───",
    "World",
    ""

], {

    color: "yellow", // the color of the box (default: no color)
    wall: "*", // the border of the box (default: the rectangle showed above)
    padding: 3, // the padding of the box (default: 1)
    center: true, // position of the box, will float left if false (default: false)
    textCenter: true // position of the text, will float left if false (default: true)

}));
output
                                 *************
                                 *           *
                                 *   Hello   *
                                 *    ───    *
                                 *   World   *
                                 *           * (the borders are yellow)
                                 ************* (trust me)
If you want to stylize the text in the box, use perfume syntax:
var tuck = require("tuck");

console.log(tuck([

    "Here are some (blue text):blue",
    "And here are some (red bold text):red:bold",

], {

    color: "yellow",
    textCenter: false

}));
output
┌─────────────────────────────────┐
│ Here are some blue text         │
│ And here are some red bold text │
└─────────────────────────────────┘ (they are styled, trust me)

CLI

Install by running npm install --global tuck (this is just for fun)

usage

tuck <text> [option]

options

--color set the color of the box (this should be the first flag) --center set the position of the box set the color of the box

Example
$ tuck 'Hello (World):red' --yellow --center

Package Sidebar

Install

npm i tuck

Weekly Downloads

3

Version

0.0.4

License

MIT

Last publish

Collaborators

  • npm