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: ['Rel', 'Change', 'By', 'When']
17
, colWidths: [6, 21, 25, 17]
18
});
19
20
table.push(
21
['v0.1', 'Testing something cool', '[email protected]', '7 minutes ago']
22
, ['v0.1', 'Testing something cool', '[email protected]', '8 minutes ago']
23
);
24
25
console.log(table.toString());
26
27
28
var table = new Table({
29
head: ['Rel', 'Change', 'By', 'When']
30
, colWidths: [6, 21, 25, 17]
31
, style : {compact : true, 'padding-left' : 1}
32
});
33
34
table.push(
35
['v0.1', 'Testing something cool', '[email protected]', '7 minutes ago']
36
, ['v0.1', 'Testing something cool', '[email protected]', '8 minutes ago']
37
, []
38
, ['v0.1', 'Testing something cool', '[email protected]', '8 minutes ago']
39
);
40
41
console.log(table.toString());
42