multiline-billboard

0.2.0 • Public • Published

multiline-billboard

Build Status Coverage Status

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:

screenshot

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'.

License

MIT

Package Sidebar

Install

npm i multiline-billboard

Weekly Downloads

3

Version

0.2.0

License

MIT

Last publish

Collaborators

  • codekirei