-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.js
82 lines (65 loc) · 1.3 KB
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
const std = require('./lib/main');
// Title
std.setwidth(16);
std.center('-');
std.write('Notes');
// Table
std.fillWith([
['hello', 'world', 5],
['okays', 'hey', 5],
['world', 'hello'],
[5, 'world', 'hello'],
]);
// Align
std.alignRight('Hello');
std.line();
// console.log(std.in.read('Hello, '));
std.reset();
std.hex();
std.writes(0x3A);
std.reset();
std.setwidth(18);
std.center('-');
std.write('Test!');
// Custom table?
std.setwidth(2);
std.setfill('0');
std.write(1);
std.raw = ' ';
std.write(5);
std.raw = ' '.repeat(14-'CONST'.length);
std.raw = 'CONST';
std.line();
// Left - right table
std.setwidth(33);
std.center('-');
std.write('Left Right!');
std.leftRightTable(
[ std.dir.hex(1), std.dir.hex(2) ],
[ 'CONST', 0, '("Hello!")' ],
);
std.setwidth(50);
std.leftRightTable(
['Value1', 'Value2'],
['I\'m on the right!'],
);
std.bin();
std.writes(0xA); // 1010
std.writes(10); // 1010
// Tables
std.reset();
std.setwidth(53);
std.center('-');
std.write('Tables');
std.writeTable([
['something', 'something else', 'idk'],
['heyzs', 'tables', 'ftw'],
['hey', 'tables', 'ftw'],
['something', 'something else', 'idk'],
], 1);
std.formatTable([
['something', 'something else', 'idk'],
['heyzs', 'tables', 'ftw'],
['hey', 'tables', 'ftw'],
['something', 'something else', 'idk'],
], 1);