multiline-billboard
v0.2.0
Published
turn your text into a fancy billboard
Downloads
6
Readme
multiline-billboard
About | Installation | Usage | License
About
A Node.js module to format a string or array of strings into a billboard. Useful for displaying text in a CLI application. Configurable colors, border characters, and justification with sane defaults.
Turn this:
console.log(billboard(
[ 'Standing in hallway'
, 'For forgetting my homework'
, 'Mogami River'
]))
Into this:
Installation
Install and require as a standard Node module.
Install
$ npm install --save multiline-billboard
Require
var billboard = require('multiline-billboard')
Usage
/*
@param {String|String[]} strOrStrs - text to put in billboard
@param {Object} [customOpts] - opts to override defaults
@returns {String} billboard
*/
billboard(strOrStrs, customOpts)
billboard
is a function that takes two params:
- a string or array of strings to build the billboard around
- an object of custom options to override the defaults (optional)
See defaults for the default options. Each option is overrideable. ansi-styles is used to color the border and text; check its documentation for supported colors. Accepted values for justify
are 'left'
, 'right'
, and 'center'
.