stack-analyze 1.1.6 → 1.1.7
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 +13 -0
- package/{about/index.js → about.js} +6 -4
- package/cli.js +12 -11
- package/env/bitly.env.js +1 -0
- package/env/movie.env.js +1 -0
- package/env/twitchID.env.js +1 -0
- package/functions/animeInfo.js +9 -39
- package/functions/bitly.js +8 -9
- package/functions/cryptoList.js +9 -38
- package/functions/gitUser.js +6 -9
- package/functions/hardware.js +32 -24
- package/functions/moviesInfo.js +10 -38
- package/functions/multipleStack.js +9 -29
- package/functions/pageSpeed.js +13 -13
- package/functions/singleStack.js +9 -32
- package/functions/twitch.js +46 -0
- package/hash/aboutOpts.js +9 -11
- package/hash/hardwareTools.js +3 -3
- package/hash/infoTools.js +46 -24
- package/hash/mainTools.js +9 -9
- package/{index.js → index.cjs} +167 -52
- package/index.mjs +474 -0
- package/models/aboutTables.js +2 -2
- package/models/animeTable.js +33 -0
- package/models/cryptoTables.js +32 -0
- package/models/hardwareTables.js +87 -0
- package/models/movieTables.js +33 -0
- package/models/stackTables.js +23 -0
- package/models/twitchTables.js +28 -0
- package/package.json +16 -9
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
stack-analyze all version and notable changes, fixed, remove and new additions in code.
|
|
4
4
|
|
|
5
|
+
## version 1.1.7
|
|
6
|
+
### Added
|
|
7
|
+
- twitch info tool
|
|
8
|
+
- remove one js module for module to cjs and esm
|
|
9
|
+
### fixed
|
|
10
|
+
- change write token to process.env varaibles own (not avalible values in github and gitlab)
|
|
11
|
+
- migrate cjs to esm
|
|
12
|
+
- rewrite module
|
|
13
|
+
### change
|
|
14
|
+
- except some hardware tools and github using models from console-table-printer
|
|
15
|
+
- now using esm now about is js file not folder about with index.js
|
|
16
|
+
- rewrite all tests functions
|
|
17
|
+
|
|
5
18
|
## version 1.1.6
|
|
6
19
|
### Added
|
|
7
20
|
- module stack-analyze mode
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
//
|
|
2
|
-
|
|
1
|
+
// package.json
|
|
2
|
+
import { createRequire } from "module";
|
|
3
|
+
const require = createRequire(import.meta.url);
|
|
4
|
+
const { license, version } = require("./package.json");
|
|
3
5
|
|
|
4
6
|
/**
|
|
5
7
|
* @type {{ mainDeveloper: string, version: string, license: string }}
|
|
@@ -41,12 +43,12 @@ const youtubeDev = [
|
|
|
41
43
|
];
|
|
42
44
|
|
|
43
45
|
/** @type { string[] } */
|
|
44
|
-
const twitch = [ "dannyaegyo" ];
|
|
46
|
+
const twitch = [ "dannyaegyo", "Lunanny" ];
|
|
45
47
|
|
|
46
48
|
/** @type { string[] } */
|
|
47
49
|
const projects = [ "Doofy's Projects" ];
|
|
48
50
|
|
|
49
|
-
|
|
51
|
+
export {
|
|
50
52
|
aboutApp,
|
|
51
53
|
developers,
|
|
52
54
|
youtubeDev,
|
package/cli.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
// modules
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
import { performance } from "perf_hooks";
|
|
5
|
+
import inquirer from "inquirer";
|
|
6
|
+
import figlet from "figlet";
|
|
7
|
+
import colors from "colors";
|
|
8
8
|
|
|
9
9
|
// hash tables
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
import mainTools from "./hash/mainTools.js";
|
|
11
|
+
import hardwareTools from "./hash/hardwareTools.js";
|
|
12
|
+
import aboutTool from "./hash/aboutOpts.js";
|
|
13
|
+
import infoTools from "./hash/infoTools.js";
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* @description about menu
|
|
@@ -64,7 +64,7 @@ async function returnWebQuestion() {
|
|
|
64
64
|
question();
|
|
65
65
|
}
|
|
66
66
|
} catch (err) {
|
|
67
|
-
console.error(red(err.message));
|
|
67
|
+
console.error(colors.red(err.message));
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
|
|
@@ -91,7 +91,7 @@ async function returnInfoQuestion() {
|
|
|
91
91
|
question();
|
|
92
92
|
}
|
|
93
93
|
} catch (err) {
|
|
94
|
-
console.error(red(err.message));
|
|
94
|
+
console.error(colors.red(err.message));
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
|
|
@@ -172,6 +172,7 @@ async function infoOpts() {
|
|
|
172
172
|
"crypto_market",
|
|
173
173
|
"bitly_info",
|
|
174
174
|
"movie_info",
|
|
175
|
+
"twitch_info",
|
|
175
176
|
"return main menu"
|
|
176
177
|
]
|
|
177
178
|
});
|
|
@@ -194,7 +195,7 @@ async function infoOpts() {
|
|
|
194
195
|
*/
|
|
195
196
|
async function question() {
|
|
196
197
|
console.clear();
|
|
197
|
-
console.info(yellow(textSync("stack-analyze")));
|
|
198
|
+
console.info(colors.yellow(figlet.textSync("stack-analyze")));
|
|
198
199
|
const { analyze } = await inquirer.prompt({
|
|
199
200
|
type: "list",
|
|
200
201
|
name: "analyze",
|
package/env/bitly.env.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
process.env.BITLY_TOKEN = "efeac58916c768e4ae6ad22fe31b601361f71886";
|
package/env/movie.env.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
process.env.MOVIE_CODE= "6bd534c04a4246666a68080da99bb105";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
process.env.CLIENT_ID = "am096eog80r416605ka34uzq8b5614";
|
package/functions/animeInfo.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// modules
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import axios from "axios";
|
|
3
|
+
import { format } from "timeago.js";
|
|
4
|
+
import colors from "colors";
|
|
5
|
+
import animeList from "../models/animeTable.js";
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
*
|
|
@@ -22,36 +22,6 @@ const animeSearch = async (query) => {
|
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
24
|
|
|
25
|
-
const animeList = new Table({
|
|
26
|
-
columns: [
|
|
27
|
-
{
|
|
28
|
-
name: "title",
|
|
29
|
-
alignment: "left",
|
|
30
|
-
color: "green"
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
name: "type",
|
|
34
|
-
alignment: "left",
|
|
35
|
-
color: "magenta"
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
name: "episodes",
|
|
39
|
-
alignment: "left",
|
|
40
|
-
color: "magenta"
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
name: "debutDate",
|
|
44
|
-
alignment: "left",
|
|
45
|
-
color: "magenta"
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
name: "finalDate",
|
|
49
|
-
alignment: "left",
|
|
50
|
-
color: "green"
|
|
51
|
-
}
|
|
52
|
-
]
|
|
53
|
-
});
|
|
54
|
-
|
|
55
25
|
const animeData = data.results.map(({
|
|
56
26
|
title,
|
|
57
27
|
episodes,
|
|
@@ -62,18 +32,18 @@ const animeSearch = async (query) => {
|
|
|
62
32
|
type,
|
|
63
33
|
episodes,
|
|
64
34
|
debutDate: format(start_date),
|
|
65
|
-
finalDate: end_date !== null
|
|
66
|
-
? format(end_date)
|
|
35
|
+
finalDate: end_date !== null
|
|
36
|
+
? format(end_date)
|
|
67
37
|
: "current date"
|
|
68
38
|
}));
|
|
69
|
-
|
|
39
|
+
|
|
70
40
|
|
|
71
41
|
animeList.addRows(animeData);
|
|
72
42
|
|
|
73
43
|
animeList.printTable();
|
|
74
44
|
|
|
75
|
-
} catch (err) { console.error(red(err.message)); }
|
|
45
|
+
} catch (err) { console.error(colors.red(err.message)); }
|
|
76
46
|
};
|
|
77
47
|
|
|
78
48
|
// exports module
|
|
79
|
-
|
|
49
|
+
export default animeSearch;
|
package/functions/bitly.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
// modules
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import "../env/bitly.env.js";
|
|
3
|
+
import axios from "axios";
|
|
4
|
+
import { format } from "timeago.js";
|
|
5
|
+
import colors from "colors";
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
*
|
|
8
9
|
* @description call the bitly info data
|
|
9
10
|
* @param { string } link - link for search info
|
|
10
|
-
* @param { string } token - token for using tool
|
|
11
11
|
* @returns { Promise<void> } - return results serach
|
|
12
12
|
*
|
|
13
13
|
*/
|
|
14
|
-
const bitlyInfo = async (link
|
|
14
|
+
const bitlyInfo = async (link) => {
|
|
15
15
|
try {
|
|
16
16
|
const { data, status } = await axios.post(
|
|
17
17
|
"https://api-ssl.bitly.com/v4/expand",
|
|
@@ -20,7 +20,7 @@ const bitlyInfo = async (link, token) => {
|
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
22
|
headers: {
|
|
23
|
-
Authorization: `Bearer ${
|
|
23
|
+
Authorization: `Bearer ${process.env.BITLY_TOKEN}`,
|
|
24
24
|
"Content-Type": "application/json"
|
|
25
25
|
}
|
|
26
26
|
}
|
|
@@ -34,10 +34,9 @@ const bitlyInfo = async (link, token) => {
|
|
|
34
34
|
link: data.long_url
|
|
35
35
|
});
|
|
36
36
|
} catch (err) {
|
|
37
|
-
console.error(red(err.message));
|
|
37
|
+
console.error(colors.red(err.message));
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
40
|
|
|
41
41
|
// export
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
export default bitlyInfo;
|
package/functions/cryptoList.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
// modules
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import CoinGecko from "coingecko-api";
|
|
3
|
+
import { format } from "timeago.js";
|
|
4
|
+
import colors from "colors";
|
|
5
|
+
|
|
6
|
+
import coinTable from "../models/cryptoTables.js";
|
|
6
7
|
|
|
7
8
|
// init coingecko api
|
|
8
9
|
const CoinGeckoClient = new CoinGecko();
|
|
@@ -32,49 +33,19 @@ const cryptoMarket = async () => {
|
|
|
32
33
|
name,
|
|
33
34
|
price: current_price,
|
|
34
35
|
priceChanged: price_change_percentage_24h > 0
|
|
35
|
-
? green(price_change_percentage_24h)
|
|
36
|
-
: red(price_change_percentage_24h),
|
|
36
|
+
? colors.green(price_change_percentage_24h)
|
|
37
|
+
: colors.red(price_change_percentage_24h),
|
|
37
38
|
lastUpdated: format(last_updated)
|
|
38
39
|
}));
|
|
39
40
|
|
|
40
|
-
// init table
|
|
41
|
-
const coinTable = new Table({
|
|
42
|
-
columns: [
|
|
43
|
-
{
|
|
44
|
-
name: "symbol",
|
|
45
|
-
alignment: "left",
|
|
46
|
-
color: "green"
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
name: "name",
|
|
50
|
-
alignment: "left",
|
|
51
|
-
color: "white_bold"
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
name: "price",
|
|
55
|
-
alignment: "left",
|
|
56
|
-
color: "yellow"
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
name: "priceChanged",
|
|
60
|
-
alignment: "left"
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
name: "lastUpdated",
|
|
64
|
-
alignment: "left",
|
|
65
|
-
color: "magenta"
|
|
66
|
-
}
|
|
67
|
-
]
|
|
68
|
-
});
|
|
69
|
-
|
|
70
41
|
coinTable.addRows(coinList);
|
|
71
42
|
|
|
72
43
|
// print table
|
|
73
44
|
coinTable.printTable();
|
|
74
45
|
} catch (err) {
|
|
75
46
|
// print err message
|
|
76
|
-
console.error(red(err.message));
|
|
47
|
+
console.error(colors.red(err.message));
|
|
77
48
|
}
|
|
78
49
|
};
|
|
79
50
|
|
|
80
|
-
|
|
51
|
+
export default cryptoMarket;
|
package/functions/gitUser.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// modules
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import axios from "axios";
|
|
3
|
+
import { format } from "timeago.js";
|
|
4
|
+
import colors from "colors";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
*
|
|
@@ -10,7 +10,7 @@ const { red, yellow } = require("colors");
|
|
|
10
10
|
* @returns { Promise<void> } - return results info
|
|
11
11
|
*
|
|
12
12
|
*/
|
|
13
|
-
async function githubInfo(user) {
|
|
13
|
+
export default async function githubInfo(user) {
|
|
14
14
|
try {
|
|
15
15
|
const res = await axios.get(`https://api.github.com/users/${user}`);
|
|
16
16
|
|
|
@@ -30,12 +30,9 @@ async function githubInfo(user) {
|
|
|
30
30
|
|
|
31
31
|
console.table(info);
|
|
32
32
|
} else {
|
|
33
|
-
console.info(yellow(res.status.toString()));
|
|
33
|
+
console.info(colors.yellow(res.status.toString()));
|
|
34
34
|
}
|
|
35
35
|
} catch(err) {
|
|
36
|
-
console.error(red(err.message));
|
|
36
|
+
console.error(colors.red(err.message));
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
|
|
40
|
-
module.exports = githubInfo;
|
|
41
|
-
|
package/functions/hardware.js
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
// modules
|
|
2
|
-
|
|
3
|
-
cpu,
|
|
4
|
-
mem,
|
|
5
|
-
osInfo,
|
|
6
|
-
diskLayout,
|
|
7
|
-
graphics,
|
|
8
|
-
bios
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
import {
|
|
3
|
+
cpu,
|
|
4
|
+
mem,
|
|
5
|
+
osInfo,
|
|
6
|
+
diskLayout,
|
|
7
|
+
graphics,
|
|
8
|
+
bios
|
|
9
|
+
} from "systeminformation";
|
|
10
|
+
import colors from "colors";
|
|
11
|
+
import {
|
|
12
|
+
controllersTable,
|
|
13
|
+
diskTables,
|
|
14
|
+
displayTables
|
|
15
|
+
} from "../models/hardwareTables.js";
|
|
12
16
|
|
|
13
17
|
|
|
14
18
|
/**
|
|
@@ -44,7 +48,7 @@ async function cpuInfo() {
|
|
|
44
48
|
model
|
|
45
49
|
});
|
|
46
50
|
} catch (err) {
|
|
47
|
-
console.error(red(err.message));
|
|
51
|
+
console.error(colors.red(err.message));
|
|
48
52
|
}
|
|
49
53
|
}
|
|
50
54
|
|
|
@@ -73,7 +77,7 @@ async function ramMemInfo() {
|
|
|
73
77
|
available_mem: `${(available / 1073741824).toFixed(2)} GB`
|
|
74
78
|
});
|
|
75
79
|
} catch (err) {
|
|
76
|
-
console.error(red(err.message));
|
|
80
|
+
console.error(colors.red(err.message));
|
|
77
81
|
}
|
|
78
82
|
}
|
|
79
83
|
|
|
@@ -108,7 +112,7 @@ async function osDetail() {
|
|
|
108
112
|
uefi
|
|
109
113
|
});
|
|
110
114
|
} catch (err) {
|
|
111
|
-
console.error(red(err.message));
|
|
115
|
+
console.error(colors.red(err.message));
|
|
112
116
|
}
|
|
113
117
|
}
|
|
114
118
|
|
|
@@ -135,11 +139,13 @@ async function diskInfo() {
|
|
|
135
139
|
diskSize: `${(size / 1073741824).toFixed(2)} GB`,
|
|
136
140
|
interfaceType
|
|
137
141
|
}));
|
|
138
|
-
|
|
139
|
-
|
|
142
|
+
|
|
143
|
+
diskTables.addRows(disksList);
|
|
144
|
+
|
|
145
|
+
diskTables.printTable();
|
|
140
146
|
|
|
141
147
|
} catch (err) {
|
|
142
|
-
console.error(red(err.message));
|
|
148
|
+
console.error(colors.red(err.message));
|
|
143
149
|
}
|
|
144
150
|
}
|
|
145
151
|
|
|
@@ -160,15 +166,16 @@ async function controllerInfo() {
|
|
|
160
166
|
}) => ({
|
|
161
167
|
model,
|
|
162
168
|
vendor,
|
|
163
|
-
vramSize: vram < 1024
|
|
169
|
+
vramSize: vram < 1024
|
|
164
170
|
? `${vram} MB`
|
|
165
171
|
: `${(vram / 1024).toFixed(2)} GB`
|
|
166
172
|
}));
|
|
167
173
|
|
|
168
174
|
// show results
|
|
169
|
-
|
|
175
|
+
controllersTable.addRows(controllersList);
|
|
176
|
+
controllersTable.printTable();
|
|
170
177
|
} catch (err) {
|
|
171
|
-
console.error(red(err.message));
|
|
178
|
+
console.error(colors.red(err.message));
|
|
172
179
|
}
|
|
173
180
|
}
|
|
174
181
|
|
|
@@ -197,9 +204,10 @@ async function displayInfo() {
|
|
|
197
204
|
}));
|
|
198
205
|
|
|
199
206
|
// show results
|
|
200
|
-
|
|
207
|
+
displayTables.addRows(displayList);
|
|
208
|
+
displayTables.printTable();
|
|
201
209
|
} catch (err) {
|
|
202
|
-
console.error(red(err.message));
|
|
210
|
+
console.error(colors.red(err.message));
|
|
203
211
|
}
|
|
204
212
|
}
|
|
205
213
|
|
|
@@ -221,16 +229,16 @@ async function biosInfo() {
|
|
|
221
229
|
console.table({
|
|
222
230
|
releaseDate,
|
|
223
231
|
vendor,
|
|
224
|
-
bios_revision: revision === "" ? "no info": revision,
|
|
232
|
+
bios_revision: revision === "" ? "no info" : revision,
|
|
225
233
|
version
|
|
226
234
|
});
|
|
227
235
|
} catch (err) {
|
|
228
|
-
console.error(red(err.message));
|
|
236
|
+
console.error(colors.red(err.message));
|
|
229
237
|
}
|
|
230
238
|
}
|
|
231
239
|
|
|
232
240
|
// exports modules
|
|
233
|
-
|
|
241
|
+
export {
|
|
234
242
|
cpuInfo,
|
|
235
243
|
ramMemInfo,
|
|
236
244
|
osDetail,
|
package/functions/moviesInfo.js
CHANGED
|
@@ -1,54 +1,26 @@
|
|
|
1
1
|
// modules
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import "../env/movie.env.js";
|
|
3
|
+
import axios from "axios";
|
|
4
|
+
import colors from "colors";
|
|
5
|
+
|
|
6
|
+
// table module
|
|
7
|
+
import movieList from "../models/movieTables.js";
|
|
5
8
|
|
|
6
9
|
/**
|
|
7
10
|
* @description movie info tool
|
|
8
|
-
* @param { string } api_key - key required for api tool
|
|
9
11
|
* @param { string } query - search any movie
|
|
10
12
|
* @returns { Promise<void> } - return movie lisy
|
|
11
13
|
*/
|
|
12
|
-
const movieDB = async (
|
|
14
|
+
const movieDB = async (query) => {
|
|
13
15
|
try {
|
|
14
16
|
const { data } = await axios.get("https://api.themoviedb.org/3/search/movie", {
|
|
15
17
|
params: {
|
|
16
|
-
api_key,
|
|
18
|
+
api_key: process.env.MOVIE_CODE,
|
|
17
19
|
query,
|
|
18
20
|
page: 1
|
|
19
21
|
}
|
|
20
22
|
});
|
|
21
23
|
|
|
22
|
-
const movieList = new Table({
|
|
23
|
-
columns: [
|
|
24
|
-
{
|
|
25
|
-
name: "title",
|
|
26
|
-
alignment: "left",
|
|
27
|
-
color: "green"
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
name: "original_language",
|
|
31
|
-
alignment: "left",
|
|
32
|
-
color: "green"
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
name: "popularity",
|
|
36
|
-
alignment: "left",
|
|
37
|
-
color: "yellow"
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
name: "vote_average",
|
|
41
|
-
alignment: "left",
|
|
42
|
-
color: "yellow"
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
name: "release_date",
|
|
46
|
-
alignment: "left",
|
|
47
|
-
color: "yellow"
|
|
48
|
-
}
|
|
49
|
-
]
|
|
50
|
-
});
|
|
51
|
-
|
|
52
24
|
const movieData = data.results
|
|
53
25
|
.map(({
|
|
54
26
|
title,
|
|
@@ -76,9 +48,9 @@ const movieDB = async (api_key, query) => {
|
|
|
76
48
|
|
|
77
49
|
movieList.printTable();
|
|
78
50
|
} catch (err) {
|
|
79
|
-
console.error(red(err.message));
|
|
51
|
+
console.error(colors.red(err.message));
|
|
80
52
|
}
|
|
81
53
|
};
|
|
82
54
|
|
|
83
55
|
// export
|
|
84
|
-
|
|
56
|
+
export default movieDB;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// modules
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import figlet from "figlet";
|
|
3
|
+
import Wappalyzer from "wappalyzer";
|
|
4
|
+
import colors from "colors";
|
|
5
|
+
import stackTable from "../models/stackTables.js";
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
*
|
|
@@ -14,26 +14,6 @@ const { Table } = require("console-table-printer");
|
|
|
14
14
|
const multipleStack = async (urls) => {
|
|
15
15
|
const wappalyzer = await new Wappalyzer();
|
|
16
16
|
|
|
17
|
-
const p = new Table({
|
|
18
|
-
columns: [
|
|
19
|
-
{
|
|
20
|
-
name: "techName",
|
|
21
|
-
alignment: "left",
|
|
22
|
-
color: "cyan"
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
name: "techWebsite",
|
|
26
|
-
alignment: "left",
|
|
27
|
-
color: "green"
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
name: "techCategories",
|
|
31
|
-
alignment: "left",
|
|
32
|
-
color: "cyan"
|
|
33
|
-
}
|
|
34
|
-
]
|
|
35
|
-
});
|
|
36
|
-
|
|
37
17
|
try {
|
|
38
18
|
await wappalyzer.init();
|
|
39
19
|
|
|
@@ -61,17 +41,17 @@ const multipleStack = async (urls) => {
|
|
|
61
41
|
techCategories: categories.map(({ name }) => name).join(", ")
|
|
62
42
|
}));
|
|
63
43
|
|
|
64
|
-
console.info(green(textSync(url, "Small")));
|
|
44
|
+
console.info(colors.green(figlet.textSync(url, "Small")));
|
|
65
45
|
console.group();
|
|
66
|
-
|
|
67
|
-
|
|
46
|
+
stackTable.addRows(stackResult);
|
|
47
|
+
stackTable.printTable();
|
|
68
48
|
console.groupEnd();
|
|
69
49
|
});
|
|
70
50
|
} catch (err) {
|
|
71
|
-
console.error(red(err.message));
|
|
51
|
+
console.error(colors.red(err.message));
|
|
72
52
|
}
|
|
73
53
|
|
|
74
54
|
await wappalyzer.destroy();
|
|
75
55
|
};
|
|
76
56
|
|
|
77
|
-
|
|
57
|
+
export default multipleStack;
|
package/functions/pageSpeed.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// modules
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import axios from "axios";
|
|
3
|
+
import { SingleBar } from "cli-progress";
|
|
4
|
+
import colors from "colors";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* @description async function mobile website pagespeed
|
|
@@ -39,13 +39,13 @@ const pageSpeed = async (url) => {
|
|
|
39
39
|
switch (true) {
|
|
40
40
|
case (mobile === 1 || mobile <= 49):
|
|
41
41
|
case (desktop === 1 || desktop <= 49):
|
|
42
|
-
b1 = new
|
|
42
|
+
b1 = new SingleBar({
|
|
43
43
|
format: "Mobile Result | {bar} || {value}/{total} || bad".red,
|
|
44
44
|
barCompleteChar: "\u2588",
|
|
45
45
|
barIncompleteChar: "\u2591",
|
|
46
46
|
hideCursor: true
|
|
47
47
|
});
|
|
48
|
-
b2 = new
|
|
48
|
+
b2 = new SingleBar({
|
|
49
49
|
format: "Desktop Result | {bar} || {value}/{total} || bad".red,
|
|
50
50
|
barCompleteChar: "\u2588",
|
|
51
51
|
barIncompleteChar: "\u2591",
|
|
@@ -54,13 +54,13 @@ const pageSpeed = async (url) => {
|
|
|
54
54
|
break;
|
|
55
55
|
case (mobile === 50 || mobile <= 89):
|
|
56
56
|
case (desktop === 50 || desktop <= 89):
|
|
57
|
-
b1 = new
|
|
57
|
+
b1 = new SingleBar({
|
|
58
58
|
format: "Mobile Result | {bar} || {value}/{total} || decent".yellow,
|
|
59
59
|
barCompleteChar: "\u2588",
|
|
60
60
|
barIncompleteChar: "\u2591",
|
|
61
61
|
hideCursor: true
|
|
62
62
|
});
|
|
63
|
-
b2 = new
|
|
63
|
+
b2 = new SingleBar({
|
|
64
64
|
format: "Desktop Result | {bar} || {value}/{total} || decent".yellow,
|
|
65
65
|
barCompleteChar: "\u2588",
|
|
66
66
|
barIncompleteChar: "\u2591",
|
|
@@ -69,13 +69,13 @@ const pageSpeed = async (url) => {
|
|
|
69
69
|
break;
|
|
70
70
|
case (mobile >= 90 || mobile === 100):
|
|
71
71
|
case (desktop >= 90 || desktop === 100):
|
|
72
|
-
b1 = new
|
|
72
|
+
b1 = new SingleBar({
|
|
73
73
|
format: "Mobile Result | {bar} || {value}/{total} || excelent".green,
|
|
74
74
|
barCompleteChar: "\u2588",
|
|
75
75
|
barIncompleteChar: "\u2591",
|
|
76
76
|
hideCursor: true
|
|
77
77
|
});
|
|
78
|
-
b2 = new
|
|
78
|
+
b2 = new SingleBar({
|
|
79
79
|
format: "Desktop Result | {bar} || {value}/{total} || excelent".green,
|
|
80
80
|
barCompleteChar: "\u2588",
|
|
81
81
|
barIncompleteChar: "\u2591",
|
|
@@ -83,13 +83,13 @@ const pageSpeed = async (url) => {
|
|
|
83
83
|
});
|
|
84
84
|
break;
|
|
85
85
|
default:
|
|
86
|
-
b1 = new
|
|
86
|
+
b1 = new SingleBar({
|
|
87
87
|
format: "Mobile Result | {bar} || {value}/{total} || undifined",
|
|
88
88
|
barCompleteChar: "\u2588",
|
|
89
89
|
barIncompleteChar: "\u2591",
|
|
90
90
|
hideCursor: true
|
|
91
91
|
});
|
|
92
|
-
b2 = new
|
|
92
|
+
b2 = new SingleBar({
|
|
93
93
|
format: "Desktop Result | {bar} || {value}/{total} || undifined",
|
|
94
94
|
barCompleteChar: "\u2588",
|
|
95
95
|
barIncompleteChar: "\u2591",
|
|
@@ -109,8 +109,8 @@ const pageSpeed = async (url) => {
|
|
|
109
109
|
b1.stop();
|
|
110
110
|
b2.stop();
|
|
111
111
|
} catch (err) {
|
|
112
|
-
console.error(red(err.message));
|
|
112
|
+
console.error(colors.red(err.message));
|
|
113
113
|
}
|
|
114
114
|
};
|
|
115
115
|
|
|
116
|
-
|
|
116
|
+
export default pageSpeed;
|