Skip to content

columnize an array of text elements for printing to terminal

License

Notifications You must be signed in to change notification settings

codekirei/columnize-array

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

columnize-array

Build Status Coverage Status

About | Installation | API | License


About

A Node.js module to columnize an array of strings for printing to the terminal.

Installation

Install and require as a standard Node module.

Install

  $ npm install --save columnize-array

Require

  var columnize = require('columnize-array')

API

columnize(array, options)

  • arrayArray — strings to columnize
  • optionsObject — customizable options
var defaultOptions =
  { gap:
    { len: 2
    , ch: ' '
    }
  , maxRowLen: 80
  , sort: false
  }
  • gap.lenNumber — minimum character width of gap between columns
  • gap.chString — character to use in gap
  • maxRowLenNumber — maximum character count of each row
  • sortBoolean or Function — whether to sort array param; true uses Array.prototype.sort(), or you can provide your own sort function function(array) {/*sorting logic*/}

License

MIT

About

columnize an array of text elements for printing to terminal

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published