diff --git a/js/doc/cli-table-demo.js b/js/doc/cli-table-demo.js new file mode 100644 index 0000000..3510ae1 --- /dev/null +++ b/js/doc/cli-table-demo.js @@ -0,0 +1,14 @@ +var Table = require('./cli-table'); + +// instantiate +var table = new Table({ + head: ['TH 1 label', 'TH 2 label'] + , colWidths: [20, 20] +}); + +// table is an Array, so you can `push`, `unshift`, `splice` and friends +table.push( + ['First value', 'Second value with overlength'] + , ['First value', 'Second value'] +); +console.log(table.toString());