summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/cli-table2/examples
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/cli-table2/examples')
-rw-r--r--deps/npm/node_modules/cli-table2/examples/basic-usage-examples.js222
-rw-r--r--deps/npm/node_modules/cli-table2/examples/col-and-row-span-examples.js358
-rw-r--r--deps/npm/node_modules/cli-table2/examples/screenshots/basic-usage-with-colors.pngbin6265 -> 0 bytes
-rw-r--r--deps/npm/node_modules/cli-table2/examples/screenshots/multi-line-colors.pngbin13063 -> 0 bytes
-rw-r--r--deps/npm/node_modules/cli-table2/examples/screenshots/truncation-with-colors.pngbin5018 -> 0 bytes
5 files changed, 0 insertions, 580 deletions
diff --git a/deps/npm/node_modules/cli-table2/examples/basic-usage-examples.js b/deps/npm/node_modules/cli-table2/examples/basic-usage-examples.js
deleted file mode 100644
index 0542b17d36..0000000000
--- a/deps/npm/node_modules/cli-table2/examples/basic-usage-examples.js
+++ /dev/null
@@ -1,222 +0,0 @@
-var Table = require('../src/table');
-var colors = require('colors/safe');
-
-module.exports = function(runTest) {
-
- function it(name, fn) {
- var result = fn();
- runTest(name, result[0], result[1], result[2]);
- }
-
- it('Basic Usage',function(){
- function makeTable(){
- // By default, headers will be red, and borders will be grey
- var table = new Table({head:['a','b']});
-
- table.push(['c','d']);
-
- return table;
- }
-
- var expected = [
- colors.gray('┌───') + colors.gray('┬───┐')
- , colors.gray('│') + colors.red(' a ') + colors.gray('│') + colors.red(' b ') + colors.gray('│')
- , colors.gray('├───') + colors.gray('┼───┤')
- , colors.gray('│') + (' c ') + colors.gray('│') + (' d ') + colors.gray('│')
- , colors.gray('└───') + colors.gray('┴───┘')
- ];
-
- return [makeTable,expected,'basic-usage-with-colors'];
- });
-
- it('Basic Usage - disable colors - (used often in the examples and tests)', function (){
- function makeTable(){
- // For most of these examples, and most of the unit tests we disable colors.
- // It makes unit tests easier to write/understand, and allows these pages to
- // display the examples as text instead of screen shots.
- var table = new Table({
- head: ['Rel', 'Change', 'By', 'When']
- , style: {
- head: [] //disable colors in header cells
- , border: [] //disable colors for the border
- }
- , colWidths: [6, 21, 25, 17] //set the widths of each column (optional)
- });
-
- table.push(
- ['v0.1', 'Testing something cool', 'rauchg@gmail.com', '7 minutes ago']
- , ['v0.1', 'Testing something cool', 'rauchg@gmail.com', '8 minutes ago']
- );
-
- return table;
- }
-
- var expected = [
- '┌──────┬─────────────────────┬─────────────────────────┬─────────────────┐'
- , '│ Rel │ Change │ By │ When │'
- , '├──────┼─────────────────────┼─────────────────────────┼─────────────────┤'
- , '│ v0.1 │ Testing something … │ rauchg@gmail.com │ 7 minutes ago │'
- , '├──────┼─────────────────────┼─────────────────────────┼─────────────────┤'
- , '│ v0.1 │ Testing something … │ rauchg@gmail.com │ 8 minutes ago │'
- , '└──────┴─────────────────────┴─────────────────────────┴─────────────────┘'
- ];
-
- return [makeTable,expected];
- });
-
- it('Create vertical tables by adding objects a that specify key-value pairs', function() {
- function makeTable(){
- var table = new Table({ style: {'padding-left':0, 'padding-right':0, head:[], border:[]} });
-
- table.push(
- {'v0.1': 'Testing something cool'}
- , {'v0.1': 'Testing something cool'}
- );
-
- return table;
- }
-
- var expected = [
- '┌────┬──────────────────────┐'
- , '│v0.1│Testing something cool│'
- , '├────┼──────────────────────┤'
- , '│v0.1│Testing something cool│'
- , '└────┴──────────────────────┘'
- ];
-
- return [makeTable,expected];
- });
-
- it('Cross tables are similar to vertical tables, but include an empty string for the first header', function() {
- function makeTable(){
- var table = new Table({ head: ["", "Header 1", "Header 2"], style: {'padding-left':0, 'padding-right':0, head:[], border:[]} }); // clear styles to prevent color output
-
- table.push(
- {"Header 3": ['v0.1', 'Testing something cool'] }
- , {"Header 4": ['v0.1', 'Testing something cool'] }
- );
-
- return table;
- }
-
- var expected = [
- '┌────────┬────────┬──────────────────────┐'
- , '│ │Header 1│Header 2 │'
- , '├────────┼────────┼──────────────────────┤'
- , '│Header 3│v0.1 │Testing something cool│'
- , '├────────┼────────┼──────────────────────┤'
- , '│Header 4│v0.1 │Testing something cool│'
- , '└────────┴────────┴──────────────────────┘'
- ];
-
- return [makeTable,expected];
- });
-
- it('Stylize the table with custom border characters', function (){
- function makeTable(){
- var table = new Table({
- chars: {
- 'top': '═'
- , 'top-mid': '╤'
- , 'top-left': '╔'
- , 'top-right': '╗'
- , 'bottom': '═'
- , 'bottom-mid': '╧'
- , 'bottom-left': '╚'
- , 'bottom-right': '╝'
- , 'left': '║'
- , 'left-mid': '╟'
- , 'right': '║'
- , 'right-mid': '╢'
- },
- style: {
- head: []
- , border: []
- }
- });
-
- table.push(
- ['foo', 'bar', 'baz']
- , ['frob', 'bar', 'quuz']
- );
-
- return table;
- }
-
- var expected = [
- '╔══════╤═════╤══════╗'
- , '║ foo │ bar │ baz ║'
- , '╟──────┼─────┼──────╢'
- , '║ frob │ bar │ quuz ║'
- , '╚══════╧═════╧══════╝'
- ];
-
- return [makeTable,expected];
- });
-
- it('Use ansi colors (i.e. colors.js) to style text within the cells at will, even across multiple lines',function(){
- function makeTable(){
- var table = new Table({style:{border:[],header:[]}});
-
- table.push([
- colors.red('Hello\nhow\nare\nyou?'),
- colors.blue('I\nam\nfine\nthanks!')
- ]);
-
- return table;
- }
-
- var expected = [
- '┌───────┬─────────┐'
- , '│ ' + colors.red('Hello') + ' │ ' + colors.blue('I') + ' │'
- , '│ ' + colors.red('how') + ' │ ' + colors.blue('am') + ' │'
- , '│ ' + colors.red('are') + ' │ ' + colors.blue('fine') + ' │'
- , '│ ' + colors.red('you?') + ' │ ' + colors.blue('thanks!') + ' │'
- , '└───────┴─────────┘'
- ];
-
- return [makeTable,expected,'multi-line-colors'];
- });
-
- it('Set `wordWrap` to true to make lines of text wrap instead of being truncated',function(){
- function makeTable(){
- var table = new Table({
- style:{border:[],header:[]},
- colWidths:[7,9],
- wordWrap:true
- });
-
- table.push([
- 'Hello how are you?',
- 'I am fine thanks!'
- ]);
-
- return table;
- }
-
- var expected = [
- '┌───────┬─────────┐'
- , '│ Hello │ I am │'
- , '│ how │ fine │'
- , '│ are │ thanks! │'
- , '│ you? │ │'
- , '└───────┴─────────┘'
- ];
-
- return [makeTable,expected];
- });
-};
-
-/* Expectation - ready to be copy/pasted and filled in. DO NOT DELETE THIS
-
-
- var expected = [
- '┌──┬───┬──┬──┐'
- , '│ │ │ │ │'
- , '├──┼───┼──┼──┤'
- , '│ │ … │ │ │'
- , '├──┼───┼──┼──┤'
- , '│ │ … │ │ │'
- , '└──┴───┴──┴──┘'
- ];
- */ \ No newline at end of file
diff --git a/deps/npm/node_modules/cli-table2/examples/col-and-row-span-examples.js b/deps/npm/node_modules/cli-table2/examples/col-and-row-span-examples.js
deleted file mode 100644
index 9cd6c1ad08..0000000000
--- a/deps/npm/node_modules/cli-table2/examples/col-and-row-span-examples.js
+++ /dev/null
@@ -1,358 +0,0 @@
-var Table = require('../src/table');
-var colors = require('colors/safe');
-
-module.exports = function(runTest) {
-
- function it(name,fn) {
- var result = fn();
- runTest(name,result[0],result[1],result[2]);
- }
-
- it('use colSpan to span columns - (colSpan above normal cell)',function(){
- function makeTable(){
- var table = new Table({style:{head:[],border:[]}});
-
- table.push(
- [{colSpan:2,content:'greetings'}],
- [{colSpan:2,content:'greetings'}],
- ['hello','howdy']
- );
-
- return table;
- }
-
- var expected = [
- '┌───────────────┐'
- , '│ greetings │'
- , '├───────────────┤'
- , '│ greetings │'
- , '├───────┬───────┤'
- , '│ hello │ howdy │'
- , '└───────┴───────┘'
- ];
-
- return [makeTable,expected];
- });
-
- it('use colSpan to span columns - (colSpan below normal cell)',function(){
- function makeTable(){
- var table = new Table({style:{head:[],border:[]}});
-
- table.push(
- ['hello','howdy'],
- [{colSpan:2,content:'greetings'}],
- [{colSpan:2,content:'greetings'}]
- );
-
- return table;
- }
-
- var expected = [
- '┌───────┬───────┐'
- , '│ hello │ howdy │'
- , '├───────┴───────┤'
- , '│ greetings │'
- , '├───────────────┤'
- , '│ greetings │'
- , '└───────────────┘'
- ];
-
- return [makeTable,expected];
- });
-
- it('use rowSpan to span rows - (rowSpan on the left side)',function(){
- function makeTable(){
- var table = new Table({style:{head:[],border:[]}});
-
- table.push(
- [{rowSpan:2,content:'greetings'},{rowSpan:2,content:'greetings',vAlign:'center'},'hello'],
- ['howdy']
- );
-
- return table;
- }
-
- var expected = [
- '┌───────────┬───────────┬───────┐'
- , '│ greetings │ │ hello │'
- , '│ │ greetings ├───────┤'
- , '│ │ │ howdy │'
- , '└───────────┴───────────┴───────┘'
- ];
-
- return [makeTable,expected];
- });
-
-
- it('use rowSpan to span rows - (rowSpan on the right side)',function(){
- function makeTable(){
- var table = new Table({style:{head:[],border:[]}});
-
- table.push(
- ['hello',{rowSpan:2,content:'greetings'},{rowSpan:2,content:'greetings',vAlign:'bottom'}],
- ['howdy']
- );
-
- return table;
- }
-
- var expected = [
- '┌───────┬───────────┬───────────┐'
- , '│ hello │ greetings │ │'
- , '├───────┤ │ │'
- , '│ howdy │ │ greetings │'
- , '└───────┴───────────┴───────────┘'
- ];
-
- return[makeTable,expected];
- });
-
- it('mix rowSpan and colSpan together for complex table layouts',function(){
- function makeTable(){
- var table = new Table({style:{head:[],border:[]}});
-
- table.push(
- [{content:'hello',colSpan:2},{rowSpan:2, colSpan:2,content:'sup'},{rowSpan:3,content:'hi'}],
- [{content:'howdy',colSpan:2}],
- ['o','k','','']
- );
-
- return table;
- }
-
- var expected = [
- '┌───────┬─────┬────┐'
- , '│ hello │ sup │ hi │'
- , '├───────┤ │ │'
- , '│ howdy │ │ │'
- , '├───┬───┼──┬──┤ │'
- , '│ o │ k │ │ │ │'
- , '└───┴───┴──┴──┴────┘'
- ];
-
- return [makeTable,expected];
- });
-
- it('multi-line content will flow across rows in rowSpan cells',function(){
- function makeTable(){
- var table = new Table({style:{head:[],border:[]}});
-
- table.push(
- ['hello',{rowSpan:2,content:'greetings\nfriends'},{rowSpan:2,content:'greetings\nfriends'}],
- ['howdy']
- );
-
- return table;
- }
-
- var expected = [
- '┌───────┬───────────┬───────────┐'
- , '│ hello │ greetings │ greetings │'
- , '├───────┤ friends │ friends │'
- , '│ howdy │ │ │'
- , '└───────┴───────────┴───────────┘'
- ];
-
- return [makeTable, expected];
- });
-
- it('multi-line content will flow across rows in rowSpan cells - (complex layout)',function(){
- function makeTable(){
- var table = new Table({style:{head:[],border:[]}});
-
- table.push(
- [{content:'hello',colSpan:2},{rowSpan:2, colSpan:2,content:'sup\nman\nhey'},{rowSpan:3,content:'hi\nyo'}],
- [{content:'howdy',colSpan:2}],
- ['o','k','','']
- );
-
- return table;
- }
-
- var expected = [
- '┌───────┬─────┬────┐'
- , '│ hello │ sup │ hi │'
- , '├───────┤ man │ yo │'
- , '│ howdy │ hey │ │'
- , '├───┬───┼──┬──┤ │'
- , '│ o │ k │ │ │ │'
- , '└───┴───┴──┴──┴────┘'
- ];
-
- return [makeTable,expected];
- });
-
- it('rowSpan cells can have a staggered layout',function(){
- function makeTable(){
- var table = new Table({style:{head:[],border:[]}});
-
- table.push(
- [{content:'a',rowSpan:2},'b'],
- [{content:'c',rowSpan:2}],
- ['d']
- );
-
- return table;
- }
-
- var expected = [
- '┌───┬───┐'
- , '│ a │ b │'
- , '│ ├───┤'
- , '│ │ c │'
- , '├───┤ │'
- , '│ d │ │'
- , '└───┴───┘'
- ];
-
- return [makeTable,expected];
- });
-
- it('the layout manager automatically create empty cells to fill in the table',function(){
- function makeTable(){
- var table = new Table({style:{head:[],border:[]}});
-
- //notice we only create 3 cells here, but the table ends up having 6.
- table.push(
- [{content:'a',rowSpan:3,colSpan:2},'b'],
- [],
- [{content:'c',rowSpan:2,colSpan:2}],
- []
- );
- return table;
- }
-
- var expected = [
- '┌───┬───┬──┐'
- , '│ a │ b │ │' // top-right and bottom-left cells are automatically created to fill the empty space
- , '│ ├───┤ │'
- , '│ │ │ │'
- , '│ ├───┴──┤'
- , '│ │ c │'
- , '├───┤ │'
- , '│ │ │'
- , '└───┴──────┘'
- ];
-
- return [makeTable,expected];
- });
-
- it('use table `rowHeights` option to fix row height. The truncation symbol will be shown on the last line.',function(){
- function makeTable(){
- var table = new Table({rowHeights:[2],style:{head:[],border:[]}});
-
- table.push(['hello\nhi\nsup']);
-
- return table;
- }
-
- var expected = [
- '┌───────┐'
- , '│ hello │'
- , '│ hi… │'
- , '└───────┘'
- ];
-
- return [makeTable,expected];
- });
-
- it('if `colWidths` is not specified, the layout manager will automatically widen rows to fit the content',function(){
- function makeTable(){
- var table = new Table({style:{head:[],border:[]}});
-
- table.push(
- [{colSpan:2,content:'hello there'}],
- ['hi', 'hi']
- );
-
- return table;
- }
-
- var expected = [
- '┌─────────────┐'
- , '│ hello there │'
- , '├──────┬──────┤'
- , '│ hi │ hi │'
- , '└──────┴──────┘'
- ];
-
- return [makeTable,expected];
- });
-
- it('you can specify a column width for only the first row, other rows will be automatically widened to fit content',function(){
- function makeTable(){
- var table = new Table({colWidths:[4],style:{head:[],border:[]}});
-
- table.push(
- [{colSpan:2,content:'hello there'}],
- ['hi',{hAlign:'center',content:'hi'}]
- );
-
- return table;
- }
-
- var expected = [
- '┌─────────────┐'
- , '│ hello there │'
- , '├────┬────────┤'
- , '│ hi │ hi │'
- , '└────┴────────┘'
- ];
-
- return [makeTable, expected];
- });
-
- it('a column with a null column width will be automatically widened to fit content',function(){
- function makeTable(){
- var table = new Table({colWidths:[null, 4],style:{head:[],border:[]}});
-
- table.push(
- [{colSpan:2,content:'hello there'}],
- [{hAlign:'right',content:'hi'}, 'hi']
- );
-
- return table;
- }
-
- var expected = [
- '┌─────────────┐'
- , '│ hello there │'
- , '├────────┬────┤'
- , '│ hi │ hi │'
- , '└────────┴────┘'
- ];
-
- return [makeTable,expected];
- });
-
- it('feel free to use colors in your content strings, column widths will be calculated correctly',function(){
- function makeTable(){
- var table = new Table({colWidths:[5],style:{head:[],border:[]}});
-
- table.push([colors.red('hello')]);
-
- return table;
- }
-
- var expected = [
- '┌─────┐'
- , '│ ' + colors.red('he') + '… │'
- , '└─────┘'
- ];
-
- return [makeTable,expected,'truncation-with-colors'];
- });
-};
-
-/*
-
- var expected = [
- '┌──┬───┬──┬──┐'
- , '│ │ │ │ │'
- , '├──┼───┼──┼──┤'
- , '│ │ … │ │ │'
- , '├──┼───┼──┼──┤'
- , '│ │ … │ │ │'
- , '└──┴───┴──┴──┘'
- ];
- */ \ No newline at end of file
diff --git a/deps/npm/node_modules/cli-table2/examples/screenshots/basic-usage-with-colors.png b/deps/npm/node_modules/cli-table2/examples/screenshots/basic-usage-with-colors.png
deleted file mode 100644
index 88399fca00..0000000000
--- a/deps/npm/node_modules/cli-table2/examples/screenshots/basic-usage-with-colors.png
+++ /dev/null
Binary files differ
diff --git a/deps/npm/node_modules/cli-table2/examples/screenshots/multi-line-colors.png b/deps/npm/node_modules/cli-table2/examples/screenshots/multi-line-colors.png
deleted file mode 100644
index 36f6f34f8d..0000000000
--- a/deps/npm/node_modules/cli-table2/examples/screenshots/multi-line-colors.png
+++ /dev/null
Binary files differ
diff --git a/deps/npm/node_modules/cli-table2/examples/screenshots/truncation-with-colors.png b/deps/npm/node_modules/cli-table2/examples/screenshots/truncation-with-colors.png
deleted file mode 100644
index d14b9d2fe1..0000000000
--- a/deps/npm/node_modules/cli-table2/examples/screenshots/truncation-with-colors.png
+++ /dev/null
Binary files differ