0.1.0 • Published 8 years ago

columnize-array v0.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

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)

  • array Array strings to columnize
  • options Object customizable options
var defaultOptions =
  { gap:
    { len: 2
    , ch: ' '
    }
  , maxRowLen: 80
  , sort: false
  }
  • gap.len Number minimum character width of gap between columns
  • gap.ch String character to use in gap
  • maxRowLen Number maximum character count of each row
  • sort Boolean 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