{"_id":"ascii-table","_rev":"264051","name":"ascii-table","description":"Easy tables for your console data","dist-tags":{"latest":"0.0.9"},"maintainers":[{"name":"sorensen","email":"mail@beausorensen.com"}],"time":{"modified":"2021-06-03T17:00:21.000Z","created":"2013-09-16T16:11:05.756Z","0.0.9":"2016-04-11T17:03:42.178Z","0.0.8":"2015-02-09T18:34:51.544Z","0.0.7":"2015-02-06T00:27:07.374Z","0.0.6":"2015-02-05T22:00:16.919Z","0.0.5":"2015-02-05T21:51:26.996Z","0.0.4":"2013-12-02T00:53:24.266Z","0.0.3":"2013-12-01T20:40:47.845Z","0.0.2":"2013-11-29T21:01:21.727Z","0.0.1":"2013-09-16T16:11:05.756Z"},"users":{"samtsai":true,"skerit":true,"thibaultcha":true,"f124275809":true,"goliatone":true,"sdolard":true,"evert0n":true,"sir_dubzz":true},"author":{"name":"Beau Sorensen","email":"mail@beausorensen.com","url":"http://github.com/sorensen"},"repository":{"type":"git","url":"git://github.com/sorensen/ascii-table.git"},"versions":{"0.0.9":{"name":"ascii-table","version":"0.0.9","license":"MIT","keywords":["table","ascii","console"],"contributors":[{"name":"Matthew Oliveira"},{"name":"Peter Daum"}],"author":{"name":"Beau Sorensen","email":"mail@beausorensen.com","url":"http://github.com/sorensen"},"description":"Easy tables for your console data","repository":{"type":"git","url":"git://github.com/sorensen/ascii-table.git"},"main":"index.js","scripts":{"test":"make test"},"devDependencies":{"mocha":"*"},"dependencies":{},"gitHead":"39e671b325578f026aa7f68503bb52d52602174e","bugs":{"url":"https://github.com/sorensen/ascii-table/issues"},"homepage":"https://github.com/sorensen/ascii-table#readme","_id":"ascii-table@0.0.9","_shasum":"06a6604d6a55d4bf41a9a47d9872d7a78da31e73","_from":".","_npmVersion":"2.14.12","_nodeVersion":"4.2.4","_npmUser":{"name":"sorensen","email":"mail@beausorensen.com"},"maintainers":[{"name":"sorensen","email":"mail@beausorensen.com"}],"dist":{"shasum":"06a6604d6a55d4bf41a9a47d9872d7a78da31e73","size":12143,"noattachment":false,"key":"/ascii-table/-/ascii-table-0.0.9.tgz","tarball":"http://registry.cnpm.dingdandao.com/ascii-table/download/ascii-table-0.0.9.tgz"},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/ascii-table-0.0.9.tgz_1460394219416_0.09910329966805875"},"directories":{},"publish_time":1460394222178,"_cnpm_publish_time":1460394222178,"_hasShrinkwrap":false},"0.0.8":{"name":"ascii-table","version":"0.0.8","license":"MIT","keywords":["table","ascii","console"],"contributors":[{"name":"Matthew Oliveira"},{"name":"Peter Daum"}],"author":{"name":"Beau Sorensen","email":"mail@beausorensen.com","url":"http://github.com/sorensen"},"description":"Easy tables for your console data","repository":{"type":"git","url":"git://github.com/sorensen/ascii-table.git"},"engines":{"node":"0.x"},"main":"index.js","scripts":{"test":"make test"},"devDependencies":{"mocha":"*"},"dependencies":{},"gitHead":"828c6bdef9d74ba8330d861c6f4f1e4bc426abcf","bugs":{"url":"https://github.com/sorensen/ascii-table/issues"},"homepage":"https://github.com/sorensen/ascii-table","_id":"ascii-table@0.0.8","_shasum":"4362e14d231fc70c0c8f9749f30df4aa7f5ed8a6","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"sorensen","email":"mail@beausorensen.com"},"maintainers":[{"name":"sorensen","email":"mail@beausorensen.com"}],"dist":{"shasum":"4362e14d231fc70c0c8f9749f30df4aa7f5ed8a6","size":12141,"noattachment":false,"key":"/ascii-table/-/ascii-table-0.0.8.tgz","tarball":"http://registry.cnpm.dingdandao.com/ascii-table/download/ascii-table-0.0.8.tgz"},"directories":{},"publish_time":1423506891544,"_cnpm_publish_time":1423506891544,"_hasShrinkwrap":false},"0.0.7":{"name":"ascii-table","version":"0.0.7","license":"MIT","keywords":["table","ascii","console"],"contributors":[{"name":"Matthew Oliveira"},{"name":"Peter Daum"}],"author":{"name":"Beau Sorensen","email":"mail@beausorensen.com","url":"http://github.com/sorensen"},"description":"Easy tables for your console data","repository":{"type":"git","url":"git://github.com/sorensen/ascii-table.git"},"engines":{"node":"0.x"},"main":"index.js","scripts":{"test":"make test"},"devDependencies":{"mocha":"*"},"dependencies":{},"gitHead":"d72e41de3486427521800f7a601c2dd330103e2e","bugs":{"url":"https://github.com/sorensen/ascii-table/issues"},"homepage":"https://github.com/sorensen/ascii-table","_id":"ascii-table@0.0.7","_shasum":"f8153cef5e369a7c2d056f65ad63c424aa1e8b8e","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"sorensen","email":"mail@beausorensen.com"},"maintainers":[{"name":"sorensen","email":"mail@beausorensen.com"}],"dist":{"shasum":"f8153cef5e369a7c2d056f65ad63c424aa1e8b8e","size":12095,"noattachment":false,"key":"/ascii-table/-/ascii-table-0.0.7.tgz","tarball":"http://registry.cnpm.dingdandao.com/ascii-table/download/ascii-table-0.0.7.tgz"},"directories":{},"publish_time":1423182427374,"_cnpm_publish_time":1423182427374,"_hasShrinkwrap":false},"0.0.6":{"name":"ascii-table","version":"0.0.6","license":"MIT","keywords":["table","ascii","console"],"author":{"name":"Beau Sorensen","email":"mail@beausorensen.com","url":"http://github.com/sorensen"},"description":"Easy tables for your console data","repository":{"type":"git","url":"git://github.com/sorensen/ascii-table.git"},"engines":{"node":"0.x"},"main":"index.js","scripts":{"test":"make test"},"devDependencies":{"mocha":"*"},"dependencies":{},"gitHead":"6aff1b66403292c39cff2d9f60d4a846054882bd","bugs":{"url":"https://github.com/sorensen/ascii-table/issues"},"homepage":"https://github.com/sorensen/ascii-table","_id":"ascii-table@0.0.6","_shasum":"521f6740b1038e9067c6f352b22d600606d2f5c0","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"sorensen","email":"mail@beausorensen.com"},"maintainers":[{"name":"sorensen","email":"mail@beausorensen.com"}],"dist":{"shasum":"521f6740b1038e9067c6f352b22d600606d2f5c0","size":11442,"noattachment":false,"key":"/ascii-table/-/ascii-table-0.0.6.tgz","tarball":"http://registry.cnpm.dingdandao.com/ascii-table/download/ascii-table-0.0.6.tgz"},"directories":{},"publish_time":1423173616919,"_cnpm_publish_time":1423173616919,"_hasShrinkwrap":false},"0.0.5":{"name":"ascii-table","version":"0.0.5","license":"MIT","keywords":["table","ascii","console"],"author":{"name":"Beau Sorensen","email":"mail@beausorensen.com","url":"http://github.com/sorensen"},"description":"Easy tables for your console data","repository":{"type":"git","url":"git://github.com/sorensen/ascii-table.git"},"engines":{"node":"0.x"},"main":"index.js","scripts":{"test":"make test"},"devDependencies":{"mocha":"*"},"dependencies":{},"gitHead":"63a190f168941428c94f50883b80b09bd314773b","bugs":{"url":"https://github.com/sorensen/ascii-table/issues"},"homepage":"https://github.com/sorensen/ascii-table","_id":"ascii-table@0.0.5","_shasum":"8f818e4c21bc94d1f1e0ae2016b7e2c8d7216152","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"sorensen","email":"mail@beausorensen.com"},"maintainers":[{"name":"sorensen","email":"mail@beausorensen.com"}],"dist":{"shasum":"8f818e4c21bc94d1f1e0ae2016b7e2c8d7216152","size":11413,"noattachment":false,"key":"/ascii-table/-/ascii-table-0.0.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/ascii-table/download/ascii-table-0.0.5.tgz"},"directories":{},"publish_time":1423173086996,"_cnpm_publish_time":1423173086996,"_hasShrinkwrap":false},"0.0.4":{"name":"ascii-table","version":"0.0.4","license":"MIT","keywords":["table","ascii","console"],"author":{"name":"Beau Sorensen","email":"mail@beausorensen.com","url":"http://github.com/sorensen"},"description":"Easy tables for your console data","repository":{"type":"git","url":"git://github.com/sorensen/ascii-table.git"},"engines":{"node":"0.x"},"main":"index.js","scripts":{"test":"make test"},"devDependencies":{"mocha":"*"},"dependencies":{},"readmeFilename":"readme.md","bugs":{"url":"https://github.com/sorensen/ascii-table/issues"},"_id":"ascii-table@0.0.4","dist":{"shasum":"7fc83882a3a283cda3be5d276e224c0658bbf6d2","size":11205,"noattachment":false,"key":"/ascii-table/-/ascii-table-0.0.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/ascii-table/download/ascii-table-0.0.4.tgz"},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"sorensen","email":"mail@beausorensen.com"},"maintainers":[{"name":"sorensen","email":"mail@beausorensen.com"}],"directories":{},"publish_time":1385945604266,"_hasShrinkwrap":false,"_cnpm_publish_time":1385945604266},"0.0.3":{"name":"ascii-table","version":"0.0.3","license":"MIT","keywords":["table","ascii","console"],"author":{"name":"Beau Sorensen","email":"mail@beausorensen.com","url":"http://github.com/sorensen"},"description":"Easy tables for your console data","repository":{"type":"git","url":"git://github.com/sorensen/ascii-table.git"},"engines":{"node":"0.x"},"main":"index.js","scripts":{"test":"make test"},"dependencies":{},"readmeFilename":"readme.md","bugs":{"url":"https://github.com/sorensen/ascii-table/issues"},"_id":"ascii-table@0.0.3","dist":{"shasum":"6031bfea8171847391d179c6231c8066a9b9b324","size":10633,"noattachment":false,"key":"/ascii-table/-/ascii-table-0.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/ascii-table/download/ascii-table-0.0.3.tgz"},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"sorensen","email":"mail@beausorensen.com"},"maintainers":[{"name":"sorensen","email":"mail@beausorensen.com"}],"directories":{},"publish_time":1385930447845,"_hasShrinkwrap":false,"_cnpm_publish_time":1385930447845},"0.0.2":{"name":"ascii-table","version":"0.0.2","license":"MIT","author":{"name":"Beau Sorensen","email":"mail@beausorensen.com","url":"http://github.com/sorensen"},"description":"Easy tables for your console data","repository":{"type":"git","url":"git://github.com/sorensen/ascii-table.git"},"engines":{"node":"0.x"},"main":"index.js","scripts":{"test":"make test"},"devDependencies":{"mocha":"~1.8.1"},"dependencies":{"colors":"~0.6.2"},"readmeFilename":"readme.md","bugs":{"url":"https://github.com/sorensen/ascii-table/issues"},"_id":"ascii-table@0.0.2","dist":{"shasum":"43ff47007371ddc1bb35f6ae8d797895bc1ec764","size":7078,"noattachment":false,"key":"/ascii-table/-/ascii-table-0.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/ascii-table/download/ascii-table-0.0.2.tgz"},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"sorensen","email":"mail@beausorensen.com"},"maintainers":[{"name":"sorensen","email":"mail@beausorensen.com"}],"directories":{},"publish_time":1385758881727,"_hasShrinkwrap":false,"_cnpm_publish_time":1385758881727},"0.0.1":{"name":"ascii-table","version":"0.0.1","license":"MIT","author":{"name":"Beau Sorensen","email":"mail@beausorensen.com","url":"http://github.com/sorensen"},"description":"Easy tables for your console data","repository":{"type":"git","url":"git://github.com/sorensen/ascii-table.git"},"engines":{"node":"0.x"},"main":"index.js","scripts":{"test":"make test"},"devDependencies":{"mocha":"~1.8.1"},"dependencies":{"colors":"~0.6.2"},"readmeFilename":"readme.md","bugs":{"url":"https://github.com/sorensen/ascii-table/issues"},"_id":"ascii-table@0.0.1","dist":{"shasum":"e786eefdab1c432a208cc69572be472278a5c2cb","size":6604,"noattachment":false,"key":"/ascii-table/-/ascii-table-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/ascii-table/download/ascii-table-0.0.1.tgz"},"_from":".","_npmVersion":"1.3.2","_npmUser":{"name":"sorensen","email":"mail@beausorensen.com"},"maintainers":[{"name":"sorensen","email":"mail@beausorensen.com"}],"directories":{},"publish_time":1379347865756,"_hasShrinkwrap":false,"_cnpm_publish_time":1379347865756}},"readme":"Ascii Table\n===========\n\n[![Build Status](https://secure.travis-ci.org/sorensen/ascii-table.png)](http://travis-ci.org/sorensen/ascii-table) \n[![devDependency Status](https://david-dm.org/sorensen/ascii-table.png)](https://david-dm.org/sorensen/ascii-table#info=dependencies)\n[![NPM version](https://badge.fury.io/js/ascii-table.png)](http://badge.fury.io/js/ascii-table)\n\nEasy table output for node debugging, but you could probably do more with it, \nsince its just a string.\n\nTable of Contents\n-----------------\n\n* [Usage](#usage)\n* [Example](#usage)\n* [API](#api)\n  - [Static Methods](#static-methods)\n    * [factory([title])](#asciitablefactorytitle)\n    * [align(direction, val, len, [pad])](#asciitablealigndirection-val-len-pad)\n    * [alignLeft(val, len, [pad])](#asciitablealignleftval-len-pad)\n    * [alignCenter(val, len, [pad])](#asciitablealigncenterval-len-pad)\n    * [alignRight(val, len, [pad])](#asciitablealignrightval-len-pad)\n    * [alignAuto(val, len, [pad])](#asciitablealignautoval-len-pad)\n    * [arrayFill(len, [val])](#asciitablearrayfilllen-val)\n  - [Instance Methods](#instance-methods)\n    * [setBorder([edge], [fill], [top], [bottom])](#instancesetborderedge-fill-top-bottom)\n    * [removeBorder()](#instanceremoveborder)\n    * [setAlign(idx, direction)](#instancesetalignidx-direction)\n    * [setAlignLeft(idx)](#instancesetalignleftidx)\n    * [setAlignCenter(idx)](#instancesetaligncenteridx)\n    * [setAlignRight(idx)](#instancesetalignrightidx)\n    * [setTitle(title)](#instancesettitletitle)\n    * [getTitle()](#instancegettitle)\n    * [setTitleAlign(direction)](#instancesettitlealigndirection)\n    * [setTitleAlignLeft()](#instancesettitlealignleft)\n    * [setTitleAlignCenter()](#instancesettitlealigncenter)\n    * [setTitleAlignRight()](#instancesettitlealignright)\n    * [sort([iterator])](#instancesortiterator)\n    * [sortColumn(idx, [iterator])](#instancesortcolumnidx-iterator)\n    * [setHeading(heading, [...])](#instancesetheadingheading)\n    * [setHeadingAlign(direction)](#instancesetheadingaligndirection)\n    * [setHeadingAlignLeft()](#instancesetheadingalignleft)\n    * [setHeadingAlignCenter()](#instancesetheadingaligncenter)\n    * [setHeadingAlignRight()](#instancesetheadingalignright)\n    * [addRow(row, [...])](#instanceaddrowrow)\n    * [addRowMatrix(rows)](#instanceaddrowmatrixrows)\n    * [setJustify([enabled])](#instancesetjustifyenabled)\n    * [toString()](#instancetostring)\n    * [toJSON()](#instancetojson)\n    * [fromJSON(obj)](#instancefromjsonobj)\n    * [clear()](#instanceclear)\n    * [clearRows()](#instanceclearrows)\n* [Install](#install)\n* [Contributors](#contributors)\n* [License](#license)\n\nUsage\n-----\n\nNode.js\n\n```js\nvar AsciiTable = require('ascii-table')\n```\n\nBrowser\n\n```html\n<script src=\"ascii-table.min.js\"></script>\n```\n\n*Note*: If using in the browser, it will be placed under `window.AsciiTable`\n\n\nExample\n-------\n\nBasic usage\n\n```js\nvar table = new AsciiTable('A Title')\ntable\n  .setHeading('', 'Name', 'Age')\n  .addRow(1, 'Bob', 52)\n  .addRow(2, 'John', 34)\n  .addRow(3, 'Jim', 83)\n\nconsole.log(table.toString())\n```\n\n```\n.----------------.\n|    A Title     |\n|----------------|\n|   | Name | Age |\n|---|------|-----|\n| 1 | Bob  |  52 |\n| 2 | John |  34 |\n| 3 | Jim  |  83 |\n'----------------'\n```\n\nWe can make a simple table without a title or headings as well.\n\n```js\nvar table = new AsciiTable()\n\ntable\n  .addRow('a', 'apple', 'Some longer string')\n  .addRow('b', 'banana', 'hi')\n  .addRow('c', 'carrot', 'meow')\n  .addRow('e', 'elephants')\n\n\nconsole.log(table.toString())\n```\n\n```\n.------------------------------------.\n| a | apple     | Some longer string |\n| b | banana    | hi                 |\n| c | carrot    | meow               |\n| e | elephants |                    |\n'------------------------------------'\n```\n\n\nAPI\n---\n\n### Static Methods\n\n#### AsciiTable\n\nSee: `AsciiTable.factory` for details on instantiation\n\n#### AsciiTable.factory([title], [options])\n\nTable instance creator\n\n* `title` - table title (optional, default `null`)\n* `options` - table options (optional)\n  - `prefix` - string prefix to add to each line on render\n\n***Note:*** If an object is passed in place of the `title`, the `fromJSON` \nmethod will be used to populate the table.\n\nExample:\n\n```js\nvar table = AsciiTable.factory('title')\n\nvar table = AsciiTable.factory({\n  title: 'Title'\n, heading: [ 'id', 'name' ]\n, rows: [ \n    [ 1, 'Bob' ]\n  , [ 2, 'Steve' ] \n  ] \n})\n```\n\n\n#### AsciiTable.align(direction, val, len, [pad])\n\nShortcut to one of the three following methods\n\n* `direction` - alignment direction (`AsciiTable.LEFT`, `AsciiTable.CENTER`, `AsciiTable.RIGHT`)\n* `val` - string to align\n* `len` - total length of created string\n* `pad` - padding / fill char (optional, default `' '`)\n\nExample:\n\n```js\ntable.align(AsciiTable.LEFT, 'hey', 7) // 'hey    '\n```\n\n\n#### AsciiTable.alignLeft(val, len, [pad])\n\n* `val` - string to align\n* `len` - total length of created string\n* `pad` - padding / fill char (optional, default `' '`)\n\nExample:\n\n```js\ntable.alignLeft('hey', 7, '-') // 'hey----'\n```\n\n\n#### AsciiTable.alignCenter(val, len, [pad])\n\n* `val` - string to align\n* `len` - total length of created string\n* `pad` - padding / fill char (optional, default `' '`)\n\nExample:\n\n```js\ntable.alignCenter('hey', 7) // '  hey  '\n```\n\n\n#### AsciiTable.alignRight(val, len, [pad])\n\n* `val` - string to align\n* `len` - total length of created string\n* `pad` - padding / fill char (optional, default `' '`)\n\nExample:\n\n```js\ntable.alignRight('hey', 7) // '    hey'\n```\n\n\n#### AsciiTable.alignAuto(val, len, [pad])\n\nAttempt to do intelligent alignment of provided `val`, `String` input will \nbe left aligned, `Number` types will be right aligned.\n\n* `val` - string to align\n* `len` - total length of created string\n* `pad` - padding / fill char (optional, default `' '`)\n\nExample:\n\n```js\ntable.align(AsciiTable.LEFT, 'hey', 7) // 'hey    '\n```\n\n\n#### AsciiTable.arrayFill(len, [val])\n\nCreate a new array at the given len, filled with the given value, mainly used internally\n\n* `len` - length of array\n* `val` - fill value (optional)\n\nExample:\n\n```js\nAsciiTable.arrayFill(4, 0) // [0, 0, 0, 0]\n```\n\n### Instance Methods\n\n#### instance.setBorder([edge], [fill], [top], [bottom])\n\nSet the border characters for rendering, if no arguments are passed it will be \nreset to defaults. If a single `edge` arg is passed, it will be used for all borders.\n\n* `edge` - horizontal edges (optional, default `|`)\n* `fill` - vertical edges (optional, default `-`)\n* `top` - top corners (optional, default `.`)\n* `bottom` - bottom corners (optional, default `'`)\n\nExample:\n\n```js\nvar table = new AsciiTable('Stars')\ntable\n  .setBorder('*')\n  .setHeading('oh', 'look')\n  .addRow('so much', 'star power')\n\nconsole.log(table.toString())\n```\n\n```\n************************\n*        Stars         *\n************************\n*   oh    *    look    *\n************************\n* so much * star power *\n************************\n```\n\n\n#### instance.removeBorder()\n\nExample:\n\n```js\ntable.removeBorder()\n\nconsole.log('' + table)\n```\n\n```\n  #     Fruit           Thing\n --- ----------- --------------------\n  a       apple   Some longer string\n  b      banana           hi\n  c      carrot          meow\n  e   elephants\n```\n\n\n#### instance.setAlign(idx, direction)\n\n* `idx` - column index to align\n* `direction` - alignment direction, (`AsciiTable.LEFT`, `AsciiTable.CENTER`, `AsciiTable.RIGHT`)\n\nExample:\n\n```js\ntable\n  .setAlign(2, AsciiTable.RIGHT)\n  .setAlign(1, AsciiTable.CENTER)\n\nconsole.log(table.toString())\n```\n\n```\n.-------------------------------------.\n| a  |   apple   | Some longer string |\n| b  |   banana  |                 hi |\n| c  |   carrot  |               meow |\n| e  | elephants |                    |\n'-------------------------------------'\n```\n\n\n#### instance.setAlignLeft(idx)\n\nAlias to `instance.setAlign(idx, AsciiTable.LEFT)`\n\n\n#### instance.setAlignCenter(idx)\n\nAlias to `instance.setAlign(idx, AsciiTable.CENTER)`\n\n\n#### instance.setAlignRight(idx)\n\nAlias to `instance.setAlign(idx, AsciiTable.RIGHT)`\n\n\n#### instance.setTitle(title)\n\n* `title` - table title\n\nExample:\n\n```js\nvar table = new AsciiTable('Old Title')\n\ntable.setTitle('New Title')\n```\n\n#### instance.getTitle()\n\nGet the current title of the table\n\nExample:\n\n```js\ntable.getTitle() // 'New Title'\n```\n\n\n#### instance.setTitleAlign(direction)\n\n* `direction` - table alignment direction\n\nExample:\n\n```js\n```\n\n\n#### instance.setTitleAlignLeft()\n\nAlias to `instance.setTitleAlign(AsciiTable.LEFT)`\n\n\n#### instance.setTitleAlignCenter()\n\nAlias to `instance.setTitleAlign(AsciiTable.CENTER)`\n\n\n#### instance.setTitleAlignRight()\n\nAlias to `instance.setTitleAlign(AsciiTable.RIGHT)`\n\n\n#### instance.sort(iterator)\n\n* `iterator` - sorting method to run against the rows\n\nExample:\n\n```js\ntable.sort(function(a, b) {\n  return a[2] - b[2]\n})\nconsole.log(table.toString())\n```\n\n```\n.----------------.\n| 2 | John |  34 |\n| 1 | Bob  |  52 |\n| 3 | Jim  |  83 |\n'----------------'\n```\n\n\n#### instance.sortColumn(index, iterator)\n\nSorting shortcut for targeting a specific column\n\n* `index` - column idx to sort\n* `iterator` - sorting method to run against column values\n\nExample:\n\n```js\n// This is quivalent to the `sort` example above\ntable.sortColumn(2, function(a, b) {\n  return a - b\n})\n```\n\n\n#### instance.setHeading(heading, [...])\n\nSet the column headings for the table, takes arguments the same way as `addRow`\n\n* `heading` - heading array or arguments\n\nExample:\n\n```js\ntable.setHeading('ID', 'Key', 'Value')\n\n// or:\n\ntable.setHeading(['ID', 'Key', 'Value'])\n```\n\n\n#### instance.setHeadingAlign(direction)\n\n* `direction` - \n\nExample:\n\n```js\n```\n\n\n#### instance.setHeadingAlignLeft()\n\nAlias to `instance.setHeadingAlignLeft(AsciiTable.LEFT)`\n\n\n#### instance.setHeadingAlignCenter()\n\nAlias to `instance.setHeadingAlignLeft(AsciiTable.CENTER)`\n\n\n#### instance.setHeadingAlignRight()\n\nAlias to `instance.setHeadingAlignLeft(AsciiTable.RIGHT)`\n\n\n#### instance.addRow(row, [...])\n\nRows can be added using a single array argument, or the arguments if multiple \nargs are used when calling the method.\n\n* `row` - array or arguments of column values\n\nExample:\n\n```js\nvar table = new AsciiTable()\n\ntable\n  .addRow(1, 'Bob', 52)\n  .addRow([2, 'John', 34])\n\nconsole.log(table.render())\n```\n\n```\n.---------------.\n| 1 | Bob  | 52 |\n| 2 | John | 34 |\n'---------------'\n```\n\n\n#### instance.addRowMatrix(rows)\n\nBulk `addRow` operation\n\n* `rows` - multidimentional array of rows\n\nExample:\n\n```js\ntable.addRowMatrix([\n  [2, 'John', 34]\n, [3, 'Jim', 83]\n])\n\n```\n\n\n#### instance.setJustify(enabled)\n\nJustify all columns to be the same width\n\n* `enabled` - boolean for turning justify on or off, `undefined` considered true\n\nExample:\n\n```js\ntable\n  .addRow('1', 'two', 'three')\n  .setJustify()\n\nconsole.log(table.toString())\n```\n\n```\n.-----------------------.\n| 1     | two   | three |\n'-----------------------'\n```\n\n\n#### instance.toString()\n\nRender the instance as a string for output\n\n**Alias**: [`valueOf`, `render`]\n\n\n#### instance.toJSON()\n\nReturn the JSON representation of the table, this also allows us to call \n`JSON.stringify` on the instance.\n\nExample:\n\n```js\nvar table = new AsciiTable('Title')\n\ntable\n  .setHeading('id', 'name')\n  .addRow(1, 'Bob')\n  .addRow(2, 'Steve')\n\nconsole.log(table.toJSON())\nconsole.log(JSON.stringify(table))\n```\n\n```js\n{\n  title: 'Title'\n, heading: [ 'id', 'name' ]\n, rows: [ \n    [ 1, 'Bob' ]\n  , [ 2, 'Steve' ] \n  ] \n}\n```\n\n```\n{\"title\":\"Title\",\"heading\":[\"id\",\"name\"],\"rows\":[[1,\"Bob\"],[2,\"Steve\"]]}\n```\n\n\n#### instance.fromJSON(obj)\n\nPopulate the table from json object, should match the `toJSON` output above.\n\n**Alias**: [`parse`]\n\nExample:\n\n```js\nvar table = new AsciiTable().fromJSON({\n  title: 'Title'\n, heading: [ 'id', 'name' ]\n, rows: [ \n    [ 1, 'Bob' ]\n  , [ 2, 'Steve' ] \n  ] \n})\n```\n\n\n#### instance.clear()\n\nClear / reset all table data\n\n**Alias**: [`reset`]\n\n\n#### instance.clearRows()\n\nReset all row data, maintains title and headings.\n\n\n\nInstall\n-------\n\nWith [npm](https://npmjs.org)\n\n```\nnpm install ascii-table\n```\n\n\nContributors\n------------\n\n[Matthew Oliveira](https://github.com/m4olivei)\n[Peter Daum](https://github.com/coders-kitchen)\n\n\nLicense\n-------\n\n(The MIT License)\n\nCopyright (c) 2013 Beau Sorensen\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_attachments":{},"homepage":"https://github.com/sorensen/ascii-table#readme","bugs":{"url":"https://github.com/sorensen/ascii-table/issues"},"license":"MIT"}