1.0.0 • Published 5 years ago

in-square v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

in-square

in-square is a package to simply output text in a square like this

npm.io

with this code

const chalk = require('chalk');
const { inSquare } = require('in-square');

const str = `
THIS IS A DEMO

${chalk.green('Serving!')}

- Local:            http://localhost:5000
- On Your Network:  http://192.168.1.8:5000

${chalk.gray('Copied local address to clipboard!')}

`
// chalk.green is to change the
// square color more details below
console.log(inSquare(str, chalk.green));

options

squareColor: (str: string) => string

squareColor is the second parameter and could be a function like chalk.green or chalk.red or whatever color you won't

textColor: (str: string) => string

textColor is the third parameter and could be also a function like chalk.green or chalk.red or whatever color you won't

maxLength: Number = 48

maxLength is the fourth parameter and determines the max length a line could be

1.0.0

5 years ago