-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathutils.js
47 lines (40 loc) · 1.02 KB
/
utils.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
const figlet = require('figlet');
const db = require('./scr/db');
let storageType;
let engine = 'main';
function printLogo(){
return console.log(figlet.textSync('bro.dev', {
font: 'Slant',
horizontalLayout: 'default',
verticalLayout: 'default',
width: 200,
whitespaceBreak: true
}));
};
function menu(){
let arr = ['1. New profile'];
let i = 1;
for (let profile of db.get_Profiles()){
i++;
arr.push(`${i}. ${profile}`);
};
return arr;
};
function timeLog(){
let now = new Date();
let hours = now.getHours();
let minutes = now.getMinutes();
let seconds = now.getSeconds();
if (hours < 10)
hours = `0${hours}`;
if (minutes < 10)
minutes = `0${minutes}`;
if (seconds < 10)
seconds = `0${seconds}`;
return `${hours}:${minutes}:${seconds} >>> `;
};
module.exports.printLogo = printLogo;
module.exports.menu = menu;
module.exports.timeLog = timeLog;
module.exports.storageType = storageType;
module.exports.engine = engine;