stack-analyze 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/about.js +14 -10
- package/api/webApis.js +25 -0
- package/cli.js +117 -382
- package/functions/animeInfo.js +8 -14
- package/functions/bitly.js +11 -16
- package/functions/cryptoList.js +6 -14
- package/functions/gitUser.js +13 -18
- package/functions/hardware.js +32 -16
- package/functions/moviesInfo.js +5 -6
- package/functions/multipleStack.js +11 -26
- package/functions/pageSpeed.js +52 -96
- package/functions/password.js +7 -12
- package/functions/scraping.js +84 -143
- package/functions/singleStack.js +3 -6
- package/functions/twitch.js +15 -22
- package/hash/queryTools.js +81 -0
- package/hash/webTools.js +58 -0
- package/index.cjs +117 -163
- package/index.mjs +120 -168
- package/package.json +9 -9
- package/utils.js +40 -4
- package/validations/infoValidations.js +37 -0
- package/validations/webValidations.js +33 -0
package/functions/animeInfo.js
CHANGED
|
@@ -7,19 +7,16 @@ import { printTable } from "console-table-printer";
|
|
|
7
7
|
/**
|
|
8
8
|
*
|
|
9
9
|
* @description call the anime serach info
|
|
10
|
-
* @
|
|
10
|
+
* @async
|
|
11
|
+
* @param { string } q - get query results
|
|
11
12
|
* @returns { Promise<void> } - return results serach
|
|
12
13
|
*
|
|
13
14
|
*/
|
|
14
|
-
|
|
15
|
-
/* error manager */
|
|
15
|
+
export default async function animeSearch(q) {
|
|
16
16
|
try {
|
|
17
17
|
// call api
|
|
18
18
|
const { data } = await axios.get("https://api.jikan.moe/v4/anime", {
|
|
19
|
-
params: {
|
|
20
|
-
q: query,
|
|
21
|
-
limit: 10
|
|
22
|
-
}
|
|
19
|
+
params: { q }
|
|
23
20
|
});
|
|
24
21
|
|
|
25
22
|
const animeData = data.data.map(({
|
|
@@ -30,17 +27,14 @@ const animeSearch = async (query) => {
|
|
|
30
27
|
type }) => ({
|
|
31
28
|
title,
|
|
32
29
|
type,
|
|
33
|
-
totalEpisodes: episodes
|
|
30
|
+
totalEpisodes: episodes || "current",
|
|
34
31
|
debutDate: format(aired.from),
|
|
35
|
-
finalDate: aired
|
|
32
|
+
finalDate: aired?.to
|
|
36
33
|
? format(aired.to)
|
|
37
34
|
: status
|
|
38
35
|
}));
|
|
39
36
|
|
|
40
37
|
|
|
41
|
-
printTable(animeData);
|
|
38
|
+
printTable(animeData.slice(0, 10));
|
|
42
39
|
} catch (err) { console.error(colors.red(err.message)); }
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// exports module
|
|
46
|
-
export default animeSearch;
|
|
40
|
+
}
|
package/functions/bitly.js
CHANGED
|
@@ -6,17 +6,17 @@ import colors from "colors";
|
|
|
6
6
|
/**
|
|
7
7
|
*
|
|
8
8
|
* @description call the bitly info data
|
|
9
|
+
* @async
|
|
9
10
|
* @param { string } link - link for search info
|
|
11
|
+
* @param { string } token - bitly api token is required
|
|
10
12
|
* @returns { Promise<void> } - return results serach
|
|
11
13
|
*
|
|
12
14
|
*/
|
|
13
|
-
|
|
15
|
+
export default async function bitlyInfo(link, token) {
|
|
14
16
|
try {
|
|
15
|
-
const { data
|
|
17
|
+
const { data } = await axios.post(
|
|
16
18
|
"https://api-ssl.bitly.com/v4/expand",
|
|
17
|
-
{
|
|
18
|
-
bitlink_id: link
|
|
19
|
-
},
|
|
19
|
+
{ bitlink_id: link },
|
|
20
20
|
{
|
|
21
21
|
headers: {
|
|
22
22
|
Authorization: `Bearer ${token}`,
|
|
@@ -25,17 +25,12 @@ const bitlyInfo = async (link, token) => {
|
|
|
25
25
|
}
|
|
26
26
|
);
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
link: data.long_url
|
|
34
|
-
});
|
|
28
|
+
console.table({
|
|
29
|
+
created_link: format(data.created_at),
|
|
30
|
+
bitly_link: data.link,
|
|
31
|
+
link: data.long_url
|
|
32
|
+
});
|
|
35
33
|
} catch (err) {
|
|
36
34
|
console.error(colors.red(err.message));
|
|
37
35
|
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// export
|
|
41
|
-
export default bitlyInfo;
|
|
36
|
+
}
|
package/functions/cryptoList.js
CHANGED
|
@@ -9,20 +9,16 @@ import { printTable } from "console-table-printer";
|
|
|
9
9
|
import { currency } from "../utils.js";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
13
12
|
* @descripiton call the crypto market list
|
|
13
|
+
* @async
|
|
14
14
|
* @returns { Promise<void> } - return results search
|
|
15
|
-
*
|
|
16
15
|
*/
|
|
17
|
-
|
|
16
|
+
export default async function cryptoMarket() {
|
|
18
17
|
try {
|
|
19
18
|
// start crypto
|
|
20
19
|
const { data } = await axios.get(
|
|
21
20
|
"https://api.coingecko.com/api/v3/coins/markets", {
|
|
22
|
-
params: {
|
|
23
|
-
vs_currency: "usd",
|
|
24
|
-
per_page: 10
|
|
25
|
-
}
|
|
21
|
+
params: { vs_currency: "usd" }
|
|
26
22
|
}
|
|
27
23
|
);
|
|
28
24
|
|
|
@@ -37,18 +33,14 @@ const cryptoMarket = async () => {
|
|
|
37
33
|
symbol,
|
|
38
34
|
name,
|
|
39
35
|
price: currency.format(current_price),
|
|
40
|
-
priceChanged: price_change_percentage_24h
|
|
41
|
-
? colors.green(price_change_percentage_24h)
|
|
42
|
-
: colors.red(price_change_percentage_24h),
|
|
36
|
+
priceChanged: `${price_change_percentage_24h.toFixed(2)} %`,
|
|
43
37
|
lastUpdated: format(last_updated)
|
|
44
38
|
}));
|
|
45
39
|
|
|
46
40
|
// print table
|
|
47
|
-
printTable(coinList);
|
|
41
|
+
printTable(coinList.slice(0, 10));
|
|
48
42
|
} catch (err) {
|
|
49
43
|
// print err message
|
|
50
44
|
console.error(colors.red(err.message));
|
|
51
45
|
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export default cryptoMarket;
|
|
46
|
+
}
|
package/functions/gitUser.js
CHANGED
|
@@ -6,32 +6,27 @@ import colors from "colors";
|
|
|
6
6
|
/**
|
|
7
7
|
*
|
|
8
8
|
* @description call github info user
|
|
9
|
+
* @async
|
|
9
10
|
* @param { string } user - get github user info
|
|
10
11
|
* @returns { Promise<void> } - return results info
|
|
11
12
|
*
|
|
12
13
|
*/
|
|
13
14
|
export default async function githubInfo(user) {
|
|
14
15
|
try {
|
|
15
|
-
const { data
|
|
16
|
+
const { data } = await axios.get(`https://api.github.com/users/${user}`);
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
repos: data.public_repos,
|
|
28
|
-
gists: data.public_gists
|
|
29
|
-
};
|
|
18
|
+
const info = {
|
|
19
|
+
username: data.login,
|
|
20
|
+
fullName: data?.name ?? "no info",
|
|
21
|
+
userFollowers: data.followers,
|
|
22
|
+
userFollowing: data.following,
|
|
23
|
+
accountAge: format(data.created_at),
|
|
24
|
+
twitter: data?.twitter_username ?? "no info",
|
|
25
|
+
repos: data.public_repos,
|
|
26
|
+
gists: data.public_gists
|
|
27
|
+
};
|
|
30
28
|
|
|
31
|
-
|
|
32
|
-
} else {
|
|
33
|
-
console.info(colors.yellow(""+status));
|
|
34
|
-
}
|
|
29
|
+
console.table(info);
|
|
35
30
|
} catch(err) {
|
|
36
31
|
console.error(colors.red(err.message));
|
|
37
32
|
}
|
package/functions/hardware.js
CHANGED
|
@@ -10,9 +10,18 @@ import {
|
|
|
10
10
|
import colors from "colors";
|
|
11
11
|
import { printTable } from "console-table-printer";
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
const timeout = 1e3;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* @param {number} size
|
|
18
|
+
* @param {number} [base = 1073741824]
|
|
19
|
+
* @returns {string}
|
|
20
|
+
*/
|
|
21
|
+
const gigabyteConvert = (size, base=1073741824) => (size / base).toFixed(2);
|
|
22
|
+
|
|
14
23
|
const hardwareTools = {
|
|
15
|
-
async cpuInfo() {
|
|
24
|
+
async cpuInfo(refreshCallback) {
|
|
16
25
|
console.clear();
|
|
17
26
|
|
|
18
27
|
try {
|
|
@@ -43,8 +52,9 @@ const hardwareTools = {
|
|
|
43
52
|
} catch (err) {
|
|
44
53
|
console.error(colors.red(err.message));
|
|
45
54
|
}
|
|
55
|
+
setTimeout(refreshCallback, timeout);
|
|
46
56
|
},
|
|
47
|
-
async ramMemInfo() {
|
|
57
|
+
async ramMemInfo(refreshCallback) {
|
|
48
58
|
console.clear();
|
|
49
59
|
|
|
50
60
|
try {
|
|
@@ -58,17 +68,18 @@ const hardwareTools = {
|
|
|
58
68
|
|
|
59
69
|
// show results
|
|
60
70
|
console.table({
|
|
61
|
-
total_mem: `${(total
|
|
62
|
-
free_mem: `${(free
|
|
63
|
-
used_mem: `${(used
|
|
64
|
-
active_mem: `${(active
|
|
65
|
-
available_mem: `${(available
|
|
71
|
+
total_mem: `${gigabyteConvert(total)} GB`,
|
|
72
|
+
free_mem: `${gigabyteConvert(free)} GB`,
|
|
73
|
+
used_mem: `${gigabyteConvert(used)} GB`,
|
|
74
|
+
active_mem: `${gigabyteConvert(active)} GB`,
|
|
75
|
+
available_mem: `${gigabyteConvert(available)} GB`
|
|
66
76
|
});
|
|
67
77
|
} catch (err) {
|
|
68
78
|
console.error(colors.red(err.message));
|
|
69
79
|
}
|
|
80
|
+
setTimeout(refreshCallback, timeout);
|
|
70
81
|
},
|
|
71
|
-
async osDetail() {
|
|
82
|
+
async osDetail(refreshCallback) {
|
|
72
83
|
console.clear();
|
|
73
84
|
|
|
74
85
|
try {
|
|
@@ -97,8 +108,9 @@ const hardwareTools = {
|
|
|
97
108
|
} catch (err) {
|
|
98
109
|
console.error(colors.red(err.message));
|
|
99
110
|
}
|
|
111
|
+
setTimeout(refreshCallback, timeout);
|
|
100
112
|
},
|
|
101
|
-
async diskInfo() {
|
|
113
|
+
async diskInfo(refreshCallback) {
|
|
102
114
|
console.clear();
|
|
103
115
|
|
|
104
116
|
try {
|
|
@@ -114,7 +126,7 @@ const hardwareTools = {
|
|
|
114
126
|
type,
|
|
115
127
|
name,
|
|
116
128
|
vendor,
|
|
117
|
-
diskSize: `${(size
|
|
129
|
+
diskSize: `${gigabyteConvert(size)} GB`,
|
|
118
130
|
interfaceType
|
|
119
131
|
}));
|
|
120
132
|
|
|
@@ -123,8 +135,9 @@ const hardwareTools = {
|
|
|
123
135
|
} catch (err) {
|
|
124
136
|
console.error(colors.red(err.message));
|
|
125
137
|
}
|
|
138
|
+
setTimeout(refreshCallback, timeout);
|
|
126
139
|
},
|
|
127
|
-
async controllerInfo() {
|
|
140
|
+
async controllerInfo(refreshCallback) {
|
|
128
141
|
console.clear();
|
|
129
142
|
|
|
130
143
|
try {
|
|
@@ -139,7 +152,7 @@ const hardwareTools = {
|
|
|
139
152
|
vendor,
|
|
140
153
|
vramSize: vram < 1024
|
|
141
154
|
? `${vram} MB`
|
|
142
|
-
: `${(vram
|
|
155
|
+
: `${gigabyteConvert(vram, 1024)} GB`
|
|
143
156
|
}));
|
|
144
157
|
|
|
145
158
|
// show results
|
|
@@ -147,8 +160,9 @@ const hardwareTools = {
|
|
|
147
160
|
} catch (err) {
|
|
148
161
|
console.error(colors.red(err.message));
|
|
149
162
|
}
|
|
163
|
+
setTimeout(refreshCallback, timeout);
|
|
150
164
|
},
|
|
151
|
-
async displayInfo() {
|
|
165
|
+
async displayInfo(refreshCallback) {
|
|
152
166
|
console.clear();
|
|
153
167
|
|
|
154
168
|
try {
|
|
@@ -173,8 +187,9 @@ const hardwareTools = {
|
|
|
173
187
|
} catch (err) {
|
|
174
188
|
console.error(colors.red(err.message));
|
|
175
189
|
}
|
|
190
|
+
setTimeout(refreshCallback, timeout);
|
|
176
191
|
},
|
|
177
|
-
async biosInfo() {
|
|
192
|
+
async biosInfo(refreshCallback) {
|
|
178
193
|
console.clear();
|
|
179
194
|
|
|
180
195
|
try {
|
|
@@ -188,12 +203,13 @@ const hardwareTools = {
|
|
|
188
203
|
console.table({
|
|
189
204
|
releaseDate,
|
|
190
205
|
vendor,
|
|
191
|
-
bios_revision: revision
|
|
206
|
+
bios_revision: revision || "no info",
|
|
192
207
|
version
|
|
193
208
|
});
|
|
194
209
|
} catch (err) {
|
|
195
210
|
console.error(colors.red(err.message));
|
|
196
211
|
}
|
|
212
|
+
setTimeout(refreshCallback, timeout);
|
|
197
213
|
}
|
|
198
214
|
};
|
|
199
215
|
|
package/functions/moviesInfo.js
CHANGED
|
@@ -5,10 +5,12 @@ import { printTable } from "console-table-printer";
|
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* @description movie info tool
|
|
8
|
+
* @async
|
|
8
9
|
* @param { string } query - search any movie
|
|
10
|
+
* @param { string } token
|
|
9
11
|
* @returns { Promise<void> } - return movie lisy
|
|
10
12
|
*/
|
|
11
|
-
|
|
13
|
+
export default async function movieDB(query, token) {
|
|
12
14
|
try {
|
|
13
15
|
const { data } = await axios.get("https://api.themoviedb.org/3/search/movie", {
|
|
14
16
|
params: {
|
|
@@ -39,13 +41,10 @@ const movieDB = async (query, token) => {
|
|
|
39
41
|
|
|
40
42
|
return primaryDate.getTime() - secondaryDate.getTime();
|
|
41
43
|
})
|
|
42
|
-
.filter((
|
|
44
|
+
.filter((data) => data?.release_date);
|
|
43
45
|
|
|
44
46
|
printTable(movieData);
|
|
45
47
|
} catch (err) {
|
|
46
48
|
console.error(colors.red(err.message));
|
|
47
49
|
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// export
|
|
51
|
-
export default movieDB;
|
|
50
|
+
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
// modules
|
|
2
|
-
import figlet from "figlet";
|
|
3
|
-
import Wappalyzer from "wappalyzer";
|
|
4
2
|
import colors from "colors";
|
|
5
3
|
import { printTable } from "console-table-printer";
|
|
4
|
+
import { wappalyzer } from "../api/webApis.js";
|
|
6
5
|
|
|
7
6
|
// list format
|
|
8
7
|
import { listFormat } from "../utils.js";
|
|
@@ -10,30 +9,21 @@ import { listFormat } from "../utils.js";
|
|
|
10
9
|
/**
|
|
11
10
|
*
|
|
12
11
|
* @description call multiple websites tech stack analyze
|
|
13
|
-
* @param { string[] }
|
|
12
|
+
* @param { string[] } urlList - tech analyze in multiples websites
|
|
14
13
|
* @returns { Promise<void> } - async results in multiples websites
|
|
15
14
|
*
|
|
16
15
|
*/
|
|
17
|
-
|
|
18
|
-
const wappalyzer = await new Wappalyzer();
|
|
19
|
-
|
|
16
|
+
export default async function multipleStack(urlList) {
|
|
20
17
|
try {
|
|
21
18
|
await wappalyzer.init();
|
|
22
19
|
|
|
23
|
-
const results = await Promise.all(
|
|
24
|
-
urls.map(async (url) => {
|
|
25
|
-
const { technologies } = await wappalyzer.open(url).analyze();
|
|
26
|
-
|
|
27
|
-
return {
|
|
28
|
-
url,
|
|
29
|
-
technologies
|
|
30
|
-
};
|
|
31
|
-
}));
|
|
32
|
-
|
|
33
20
|
console.info("multiple websites tech stack \n");
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
21
|
+
|
|
22
|
+
for await (const url of urlList) {
|
|
23
|
+
console.info(url.green);
|
|
24
|
+
|
|
25
|
+
const { technologies } = await wappalyzer.open(url).analyze();
|
|
26
|
+
|
|
37
27
|
const stackResult = technologies.map(({
|
|
38
28
|
name,
|
|
39
29
|
website,
|
|
@@ -47,16 +37,11 @@ const multipleStack = async (urls) => {
|
|
|
47
37
|
};
|
|
48
38
|
});
|
|
49
39
|
|
|
50
|
-
console.info(colors.green(figlet.textSync(url, "Small")));
|
|
51
|
-
console.group();
|
|
52
40
|
printTable(stackResult);
|
|
53
|
-
|
|
54
|
-
});
|
|
41
|
+
}
|
|
55
42
|
} catch (err) {
|
|
56
43
|
console.error(colors.red(err.message));
|
|
57
44
|
}
|
|
58
45
|
|
|
59
46
|
await wappalyzer.destroy();
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export default multipleStack;
|
|
47
|
+
}
|
package/functions/pageSpeed.js
CHANGED
|
@@ -1,116 +1,72 @@
|
|
|
1
1
|
// modules
|
|
2
|
-
import {
|
|
3
|
-
import { SingleBar } from "cli-progress";
|
|
2
|
+
import { MultiBar, Presets } from "cli-progress";
|
|
4
3
|
import colors from "colors";
|
|
5
4
|
|
|
5
|
+
// pagespeed api
|
|
6
|
+
import { pagespeedApi } from "../api/webApis.js";
|
|
7
|
+
|
|
8
|
+
const maxScore = 100;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* It takes a score and a bar, and returns a color based on the score
|
|
12
|
+
* @param {number} score - The score of the current test.
|
|
13
|
+
* @returns {string} A function that takes two parameters, score and bar.
|
|
14
|
+
*/
|
|
15
|
+
const barColor = score => {
|
|
16
|
+
const bar = "{bar}";
|
|
17
|
+
|
|
18
|
+
switch (true) {
|
|
19
|
+
case score === 1 || score <= 49:
|
|
20
|
+
return bar.red;
|
|
21
|
+
case score === 50 || score <= 89:
|
|
22
|
+
return bar.yellow;
|
|
23
|
+
case score >= 90 || score === maxScore:
|
|
24
|
+
return bar.green;
|
|
25
|
+
default:
|
|
26
|
+
return bar.magenta;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
|
|
6
30
|
/**
|
|
7
31
|
* @description async function mobile website pagespeed
|
|
32
|
+
* @async
|
|
8
33
|
* @param { string } url - website from pagespeed mobile results
|
|
9
34
|
* @returns { Promise<void> } - return async mobile results
|
|
10
35
|
*/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
params: {
|
|
14
|
-
url,
|
|
15
|
-
key: "AIzaSyBEDaW4FxSZ2s1vz5CdD5Ai6PGZGdAzij0",
|
|
16
|
-
strategy: "mobile"
|
|
17
|
-
}
|
|
18
|
-
});
|
|
36
|
+
export default async function pagespeed(url) {
|
|
37
|
+
console.info(url.green);
|
|
19
38
|
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
});
|
|
39
|
+
const multibar = new MultiBar({
|
|
40
|
+
format: "{type} | {bar} | {value}/{total}",
|
|
41
|
+
hideCursor: true,
|
|
42
|
+
clearOnComplete: false
|
|
43
|
+
}, Presets.legacy);
|
|
27
44
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
45
|
+
try {
|
|
46
|
+
// start api
|
|
47
|
+
const { data: resMobile } = await pagespeedApi(url, "mobile");
|
|
48
|
+
const { data: resDesktop } = await pagespeedApi(url, "desktop");
|
|
31
49
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
50
|
+
// extract results
|
|
51
|
+
const mobile = Math.round(resMobile.lighthouseResult.categories.performance.score * 100);
|
|
52
|
+
const desktop = Math.round(resDesktop.lighthouseResult.categories.performance.score * 100);
|
|
35
53
|
|
|
36
|
-
|
|
54
|
+
// result pagespeed color bar
|
|
55
|
+
const b1 = multibar.create(maxScore, 0, { type: "mobile" }, {
|
|
56
|
+
format: `{type} | ${barColor(mobile)} | {value}/{total}`
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
const b2 = multibar.create(maxScore, 0, { type: "desktop" }, {
|
|
60
|
+
format: `{type} | ${barColor(desktop)} | {value}/{total}`
|
|
61
|
+
});
|
|
37
62
|
|
|
38
|
-
// valid results
|
|
39
|
-
switch (true) {
|
|
40
|
-
case (mobile === 1 || mobile <= 49):
|
|
41
|
-
case (desktop === 1 || desktop <= 49):
|
|
42
|
-
b1 = new SingleBar({
|
|
43
|
-
format: "Mobile Result | {bar} || {value}/{total} || bad".red,
|
|
44
|
-
barCompleteChar: "\u2588",
|
|
45
|
-
barIncompleteChar: "\u2591",
|
|
46
|
-
hideCursor: true
|
|
47
|
-
});
|
|
48
|
-
b2 = new SingleBar({
|
|
49
|
-
format: "Desktop Result | {bar} || {value}/{total} || bad".red,
|
|
50
|
-
barCompleteChar: "\u2588",
|
|
51
|
-
barIncompleteChar: "\u2591",
|
|
52
|
-
hideCursor: true
|
|
53
|
-
});
|
|
54
|
-
break;
|
|
55
|
-
case (mobile === 50 || mobile <= 89):
|
|
56
|
-
case (desktop === 50 || desktop <= 89):
|
|
57
|
-
b1 = new SingleBar({
|
|
58
|
-
format: "Mobile Result | {bar} || {value}/{total} || decent".yellow,
|
|
59
|
-
barCompleteChar: "\u2588",
|
|
60
|
-
barIncompleteChar: "\u2591",
|
|
61
|
-
hideCursor: true
|
|
62
|
-
});
|
|
63
|
-
b2 = new SingleBar({
|
|
64
|
-
format: "Desktop Result | {bar} || {value}/{total} || decent".yellow,
|
|
65
|
-
barCompleteChar: "\u2588",
|
|
66
|
-
barIncompleteChar: "\u2591",
|
|
67
|
-
hideCursor: true
|
|
68
|
-
});
|
|
69
|
-
break;
|
|
70
|
-
case (mobile >= 90 || mobile === 100):
|
|
71
|
-
case (desktop >= 90 || desktop === 100):
|
|
72
|
-
b1 = new SingleBar({
|
|
73
|
-
format: "Mobile Result | {bar} || {value}/{total} || excelent".green,
|
|
74
|
-
barCompleteChar: "\u2588",
|
|
75
|
-
barIncompleteChar: "\u2591",
|
|
76
|
-
hideCursor: true
|
|
77
|
-
});
|
|
78
|
-
b2 = new SingleBar({
|
|
79
|
-
format: "Desktop Result | {bar} || {value}/{total} || excelent".green,
|
|
80
|
-
barCompleteChar: "\u2588",
|
|
81
|
-
barIncompleteChar: "\u2591",
|
|
82
|
-
hideCursor: true
|
|
83
|
-
});
|
|
84
|
-
break;
|
|
85
|
-
default:
|
|
86
|
-
b1 = new SingleBar({
|
|
87
|
-
format: "Mobile Result | {bar} || {value}/{total} || undifined",
|
|
88
|
-
barCompleteChar: "\u2588",
|
|
89
|
-
barIncompleteChar: "\u2591",
|
|
90
|
-
hideCursor: true
|
|
91
|
-
});
|
|
92
|
-
b2 = new SingleBar({
|
|
93
|
-
format: "Desktop Result | {bar} || {value}/{total} || undifined",
|
|
94
|
-
barCompleteChar: "\u2588",
|
|
95
|
-
barIncompleteChar: "\u2591",
|
|
96
|
-
hideCursor: true
|
|
97
|
-
});
|
|
98
|
-
break;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
63
|
// initials bars
|
|
102
|
-
b1.start(100, 0);
|
|
103
|
-
b2.start(100, 0);
|
|
104
|
-
|
|
105
64
|
b1.update(mobile);
|
|
106
65
|
b2.update(desktop);
|
|
107
66
|
|
|
108
|
-
// stop
|
|
109
|
-
|
|
110
|
-
b2.stop();
|
|
67
|
+
// stop multibar
|
|
68
|
+
multibar.stop();
|
|
111
69
|
} catch (err) {
|
|
112
70
|
console.error(colors.red(err.message));
|
|
113
71
|
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
export default pageSpeed;
|
|
72
|
+
}
|
package/functions/password.js
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* @returns { void }
|
|
7
|
-
*/
|
|
8
|
-
const genPassword = () => {
|
|
1
|
+
/**
|
|
2
|
+
* It generates a random password
|
|
3
|
+
* @returns {void}
|
|
4
|
+
*/
|
|
5
|
+
export default function genPassword() {
|
|
9
6
|
const chars = "0123456789abcdefghijklmnopqrstuvwxyz!@#$%^&*()ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
10
7
|
|
|
11
8
|
// blank password var
|
|
@@ -19,7 +16,5 @@ const genPassword = () => {
|
|
|
19
16
|
}
|
|
20
17
|
|
|
21
18
|
// print new passwors
|
|
22
|
-
console.info(
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export default genPassword;
|
|
19
|
+
console.info("new password:", password);
|
|
20
|
+
}
|