0.1.0 • Published 10 years ago
columnize-array v0.1.0
columnize-array
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-arrayRequire
var columnize = require('columnize-array')API
columnize(array, options)
array— Array — strings to columnizeoptions— Object — customizable options
var defaultOptions =
{ gap:
{ len: 2
, ch: ' '
}
, maxRowLen: 80
, sort: false
}gap.len— Number — minimum character width of gap between columnsgap.ch— String — character to use in gapmaxRowLen— Number — maximum character count of each rowsort— Boolean or Function — whether to sortarrayparam;trueusesArray.prototype.sort(), or you can provide your own sort functionfunction(array) {/*sorting logic*/}
License
0.1.0
10 years ago