-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathstart.js
More file actions
39 lines (27 loc) · 823 Bytes
/
start.js
File metadata and controls
39 lines (27 loc) · 823 Bytes
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
var Janeway = require('./index.js');
Janeway.start(function onReady(err) {
var spinner,
id,
i = 0;
console.log('At ease, ensign. Before you sprain something.');
Janeway.setTitle('Janeway\'s terminal title');
Janeway.setStatus('This is the statusbar');
// Some crappy code just to show how status setText works
id = setInterval(function spinnerInterval() {
var spintext;
if (!spinner) {
spinner = Janeway.setStatus();
}
i += 10;
spintext = Janeway.Blast.Bound.String.multiply('*', Math.ceil(i/10));
spintext += Janeway.Blast.Bound.String.multiply(' ', Math.ceil((100-i)/10));
spinner.setText(spintext);
if (i == 100) {
clearInterval(id);
}
}, 500);
});
process.on('uncaughtException', function onError(error) {
Janeway.debug('Found error...');
Janeway.debug(error);
});