columnize-array

0.1.0 • Public • Published

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

/columnize-array/

    Package Sidebar

    Install

    npm i columnize-array

    Weekly Downloads

    10

    Version

    0.1.0

    License

    MIT

    Last publish

    Collaborators

    • codekirei