Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
80682 views
1
2
/**
3
* Module requirements.
4
*/
5
6
// this line is only needed if you refuse to use npm
7
require.paths.unshift(__dirname + '/../support/colors');
8
9
var Table = require('../lib/cli-table');
10
11
/**
12
* Example.
13
*/
14
15
var table = new Table({
16
head: ['First', 'Last', 'Email', 'Twitter']
17
, chars: {
18
'top': '-'
19
, 'top-mid': '-'
20
, 'top-left': '-'
21
, 'top-right': '-'
22
, 'bottom': '-'
23
, 'bottom-mid': '-'
24
, 'bottom-left': '-'
25
, 'bottom-right': '-'
26
, 'left': '|'
27
, 'left-mid': '|'
28
, 'mid': '-'
29
, 'mid-mid': '-'
30
, 'right': '|'
31
, 'right-mid': '-'
32
}
33
, colWidths: [14, 10, 25, 17]
34
});
35
36
table.push(
37
['Guillermo', 'Rauch', '[email protected]', 'rauchg']
38
);
39
40
console.log(table.toString());
41
42