stack-analyze 1.1.7 → 1.2.0
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 +33 -3
- package/about.js +97 -45
- package/cli.js +313 -109
- package/functions/animeInfo.js +12 -15
- package/functions/bitly.js +3 -4
- package/functions/cryptoList.js +16 -13
- package/functions/gitUser.js +14 -14
- package/functions/hardware.js +195 -243
- package/functions/moviesInfo.js +5 -10
- package/functions/multipleStack.js +13 -8
- package/functions/pageSpeed.js +1 -1
- package/functions/password.js +25 -0
- package/functions/scraping.js +153 -0
- package/functions/singleStack.js +14 -9
- package/functions/twitch.js +5 -7
- package/index.cjs +177 -139
- package/index.mjs +179 -140
- package/package.json +18 -18
- package/readme.md +38 -7
- package/utils.js +15 -0
- package/env/bitly.env.js +0 -1
- package/env/movie.env.js +0 -1
- package/env/twitchID.env.js +0 -1
- package/hash/aboutOpts.js +0 -53
- package/hash/hardwareTools.js +0 -47
- package/hash/infoTools.js +0 -112
- package/hash/mainTools.js +0 -67
- package/models/aboutTables.js +0 -40
- package/models/animeTable.js +0 -33
- package/models/cryptoTables.js +0 -32
- package/models/hardwareTables.js +0 -87
- package/models/movieTables.js +0 -33
- package/models/stackTables.js +0 -23
- package/models/twitchTables.js +0 -28
package/functions/hardware.js
CHANGED
|
@@ -1,249 +1,201 @@
|
|
|
1
1
|
// modules
|
|
2
|
-
import {
|
|
3
|
-
cpu,
|
|
4
|
-
mem,
|
|
5
|
-
osInfo,
|
|
6
|
-
diskLayout,
|
|
7
|
-
graphics,
|
|
8
|
-
bios
|
|
2
|
+
import {
|
|
3
|
+
cpu,
|
|
4
|
+
mem,
|
|
5
|
+
osInfo,
|
|
6
|
+
diskLayout,
|
|
7
|
+
graphics,
|
|
8
|
+
bios
|
|
9
9
|
} from "systeminformation";
|
|
10
10
|
import colors from "colors";
|
|
11
|
-
import {
|
|
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
|
-
console.
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
console.
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
resolutionY
|
|
198
|
-
}) => ({
|
|
199
|
-
model,
|
|
200
|
-
main,
|
|
201
|
-
connection,
|
|
202
|
-
resolutionX,
|
|
203
|
-
resolutionY
|
|
204
|
-
}));
|
|
205
|
-
|
|
206
|
-
// show results
|
|
207
|
-
displayTables.addRows(displayList);
|
|
208
|
-
displayTables.printTable();
|
|
209
|
-
} catch (err) {
|
|
210
|
-
console.error(colors.red(err.message));
|
|
11
|
+
import { printTable } from "console-table-printer";
|
|
12
|
+
|
|
13
|
+
/** @type {Object.<string, function(): Promise<void>>} */
|
|
14
|
+
const hardwareTools = {
|
|
15
|
+
async cpuInfo() {
|
|
16
|
+
console.clear();
|
|
17
|
+
|
|
18
|
+
try {
|
|
19
|
+
const {
|
|
20
|
+
manufacturer,
|
|
21
|
+
brand,
|
|
22
|
+
speed,
|
|
23
|
+
cores,
|
|
24
|
+
physicalCores,
|
|
25
|
+
processors,
|
|
26
|
+
vendor,
|
|
27
|
+
family,
|
|
28
|
+
model
|
|
29
|
+
} = await cpu();
|
|
30
|
+
|
|
31
|
+
// show results
|
|
32
|
+
console.table({
|
|
33
|
+
manufacturer,
|
|
34
|
+
brand,
|
|
35
|
+
speed,
|
|
36
|
+
cores,
|
|
37
|
+
physicalCores,
|
|
38
|
+
processors,
|
|
39
|
+
vendor,
|
|
40
|
+
family,
|
|
41
|
+
model
|
|
42
|
+
});
|
|
43
|
+
} catch (err) {
|
|
44
|
+
console.error(colors.red(err.message));
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
async ramMemInfo() {
|
|
48
|
+
console.clear();
|
|
49
|
+
|
|
50
|
+
try {
|
|
51
|
+
const {
|
|
52
|
+
total,
|
|
53
|
+
free,
|
|
54
|
+
used,
|
|
55
|
+
active,
|
|
56
|
+
available
|
|
57
|
+
} = await mem();
|
|
58
|
+
|
|
59
|
+
// show results
|
|
60
|
+
console.table({
|
|
61
|
+
total_mem: `${(total / 1073741824).toFixed(2)} GB`,
|
|
62
|
+
free_mem: `${(free / 1073741824).toFixed(2)} GB`,
|
|
63
|
+
used_mem: `${(used / 1073741824).toFixed(2)} GB`,
|
|
64
|
+
active_mem: `${(active / 1073741824).toFixed(2)} GB`,
|
|
65
|
+
available_mem: `${(available / 1073741824).toFixed(2)} GB`
|
|
66
|
+
});
|
|
67
|
+
} catch (err) {
|
|
68
|
+
console.error(colors.red(err.message));
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
async osDetail() {
|
|
72
|
+
console.clear();
|
|
73
|
+
|
|
74
|
+
try {
|
|
75
|
+
const {
|
|
76
|
+
hostname,
|
|
77
|
+
platform,
|
|
78
|
+
distro,
|
|
79
|
+
release,
|
|
80
|
+
kernel,
|
|
81
|
+
arch,
|
|
82
|
+
serial,
|
|
83
|
+
uefi
|
|
84
|
+
} = await osInfo();
|
|
85
|
+
|
|
86
|
+
// show results
|
|
87
|
+
console.table({
|
|
88
|
+
hostname,
|
|
89
|
+
platform,
|
|
90
|
+
distro,
|
|
91
|
+
release,
|
|
92
|
+
kernel,
|
|
93
|
+
arch,
|
|
94
|
+
serial,
|
|
95
|
+
uefi
|
|
96
|
+
});
|
|
97
|
+
} catch (err) {
|
|
98
|
+
console.error(colors.red(err.message));
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
async diskInfo() {
|
|
102
|
+
console.clear();
|
|
103
|
+
|
|
104
|
+
try {
|
|
105
|
+
const disks = await diskLayout();
|
|
106
|
+
|
|
107
|
+
const disksList = disks.map(({
|
|
108
|
+
type,
|
|
109
|
+
name,
|
|
110
|
+
vendor,
|
|
111
|
+
size,
|
|
112
|
+
interfaceType
|
|
113
|
+
}) => ({
|
|
114
|
+
type,
|
|
115
|
+
name,
|
|
116
|
+
vendor,
|
|
117
|
+
diskSize: `${(size / 1073741824).toFixed(2)} GB`,
|
|
118
|
+
interfaceType
|
|
119
|
+
}));
|
|
120
|
+
|
|
121
|
+
printTable(disksList);
|
|
122
|
+
|
|
123
|
+
} catch (err) {
|
|
124
|
+
console.error(colors.red(err.message));
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
async controllerInfo() {
|
|
128
|
+
console.clear();
|
|
129
|
+
|
|
130
|
+
try {
|
|
131
|
+
const { controllers } = await graphics();
|
|
132
|
+
|
|
133
|
+
const controllersList = controllers.map(({
|
|
134
|
+
model,
|
|
135
|
+
vendor,
|
|
136
|
+
vram
|
|
137
|
+
}) => ({
|
|
138
|
+
model,
|
|
139
|
+
vendor,
|
|
140
|
+
vramSize: vram < 1024
|
|
141
|
+
? `${vram} MB`
|
|
142
|
+
: `${(vram / 1024).toFixed(2)} GB`
|
|
143
|
+
}));
|
|
144
|
+
|
|
145
|
+
// show results
|
|
146
|
+
printTable(controllersList);
|
|
147
|
+
} catch (err) {
|
|
148
|
+
console.error(colors.red(err.message));
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
async displayInfo() {
|
|
152
|
+
console.clear();
|
|
153
|
+
|
|
154
|
+
try {
|
|
155
|
+
const { displays } = await graphics();
|
|
156
|
+
|
|
157
|
+
const displayList = displays.map(({
|
|
158
|
+
model,
|
|
159
|
+
main,
|
|
160
|
+
connection,
|
|
161
|
+
resolutionX,
|
|
162
|
+
resolutionY
|
|
163
|
+
}) => ({
|
|
164
|
+
model,
|
|
165
|
+
main,
|
|
166
|
+
connection,
|
|
167
|
+
resolutionX,
|
|
168
|
+
resolutionY
|
|
169
|
+
}));
|
|
170
|
+
|
|
171
|
+
// show results
|
|
172
|
+
printTable(displayList);
|
|
173
|
+
} catch (err) {
|
|
174
|
+
console.error(colors.red(err.message));
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
async biosInfo() {
|
|
178
|
+
console.clear();
|
|
179
|
+
|
|
180
|
+
try {
|
|
181
|
+
const {
|
|
182
|
+
releaseDate,
|
|
183
|
+
vendor,
|
|
184
|
+
revision,
|
|
185
|
+
version
|
|
186
|
+
} = await bios();
|
|
187
|
+
|
|
188
|
+
console.table({
|
|
189
|
+
releaseDate,
|
|
190
|
+
vendor,
|
|
191
|
+
bios_revision: revision === "" ? "no info" : revision,
|
|
192
|
+
version
|
|
193
|
+
});
|
|
194
|
+
} catch (err) {
|
|
195
|
+
console.error(colors.red(err.message));
|
|
196
|
+
}
|
|
211
197
|
}
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
/**
|
|
215
|
-
*
|
|
216
|
-
* @description call the async function biosinfo
|
|
217
|
-
* @return { Promise<void> } - return bios info results
|
|
218
|
-
*
|
|
219
|
-
*/
|
|
220
|
-
async function biosInfo() {
|
|
221
|
-
try {
|
|
222
|
-
const {
|
|
223
|
-
releaseDate,
|
|
224
|
-
vendor,
|
|
225
|
-
revision,
|
|
226
|
-
version
|
|
227
|
-
} = await bios();
|
|
228
|
-
|
|
229
|
-
console.table({
|
|
230
|
-
releaseDate,
|
|
231
|
-
vendor,
|
|
232
|
-
bios_revision: revision === "" ? "no info" : revision,
|
|
233
|
-
version
|
|
234
|
-
});
|
|
235
|
-
} catch (err) {
|
|
236
|
-
console.error(colors.red(err.message));
|
|
237
|
-
}
|
|
238
|
-
}
|
|
198
|
+
};
|
|
239
199
|
|
|
240
200
|
// exports modules
|
|
241
|
-
export
|
|
242
|
-
cpuInfo,
|
|
243
|
-
ramMemInfo,
|
|
244
|
-
osDetail,
|
|
245
|
-
diskInfo,
|
|
246
|
-
controllerInfo,
|
|
247
|
-
displayInfo,
|
|
248
|
-
biosInfo
|
|
249
|
-
};
|
|
201
|
+
export default hardwareTools;
|
package/functions/moviesInfo.js
CHANGED
|
@@ -1,21 +1,18 @@
|
|
|
1
1
|
// modules
|
|
2
|
-
import "
|
|
3
|
-
import axios from "axios";
|
|
2
|
+
import { default as axios } from "axios";
|
|
4
3
|
import colors from "colors";
|
|
5
|
-
|
|
6
|
-
// table module
|
|
7
|
-
import movieList from "../models/movieTables.js";
|
|
4
|
+
import { printTable } from "console-table-printer";
|
|
8
5
|
|
|
9
6
|
/**
|
|
10
7
|
* @description movie info tool
|
|
11
8
|
* @param { string } query - search any movie
|
|
12
9
|
* @returns { Promise<void> } - return movie lisy
|
|
13
10
|
*/
|
|
14
|
-
const movieDB = async (query) => {
|
|
11
|
+
const movieDB = async (query, token) => {
|
|
15
12
|
try {
|
|
16
13
|
const { data } = await axios.get("https://api.themoviedb.org/3/search/movie", {
|
|
17
14
|
params: {
|
|
18
|
-
api_key:
|
|
15
|
+
api_key: token,
|
|
19
16
|
query,
|
|
20
17
|
page: 1
|
|
21
18
|
}
|
|
@@ -44,9 +41,7 @@ const movieDB = async (query) => {
|
|
|
44
41
|
})
|
|
45
42
|
.filter(({ release_date }) => release_date !== undefined && release_date !== "");
|
|
46
43
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
movieList.printTable();
|
|
44
|
+
printTable(movieData);
|
|
50
45
|
} catch (err) {
|
|
51
46
|
console.error(colors.red(err.message));
|
|
52
47
|
}
|
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
import figlet from "figlet";
|
|
3
3
|
import Wappalyzer from "wappalyzer";
|
|
4
4
|
import colors from "colors";
|
|
5
|
-
import
|
|
5
|
+
import { printTable } from "console-table-printer";
|
|
6
|
+
|
|
7
|
+
// list format
|
|
8
|
+
import { listFormat } from "../utils.js";
|
|
6
9
|
|
|
7
10
|
/**
|
|
8
11
|
*
|
|
@@ -35,16 +38,18 @@ const multipleStack = async (urls) => {
|
|
|
35
38
|
name,
|
|
36
39
|
website,
|
|
37
40
|
categories
|
|
38
|
-
}) =>
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
}) => {
|
|
42
|
+
const stackCategories = categories.map(({ name }) => name);
|
|
43
|
+
return {
|
|
44
|
+
techName: name,
|
|
45
|
+
techWebsite: website,
|
|
46
|
+
techCategories: listFormat.format(stackCategories)
|
|
47
|
+
};
|
|
48
|
+
});
|
|
43
49
|
|
|
44
50
|
console.info(colors.green(figlet.textSync(url, "Small")));
|
|
45
51
|
console.group();
|
|
46
|
-
|
|
47
|
-
stackTable.printTable();
|
|
52
|
+
printTable(stackResult);
|
|
48
53
|
console.groupEnd();
|
|
49
54
|
});
|
|
50
55
|
} catch (err) {
|
package/functions/pageSpeed.js
CHANGED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import colors from "colors";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* @description generate a new password
|
|
6
|
+
* @returns { void }
|
|
7
|
+
*/
|
|
8
|
+
const genPassword = () => {
|
|
9
|
+
const chars = "0123456789abcdefghijklmnopqrstuvwxyz!@#$%^&*()ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
10
|
+
|
|
11
|
+
// blank password var
|
|
12
|
+
let password = "";
|
|
13
|
+
|
|
14
|
+
// loop generate chars
|
|
15
|
+
for(let i = 0; i < 12; i++) {
|
|
16
|
+
const randomNumber = Math.floor(Math.random() * chars.length);
|
|
17
|
+
|
|
18
|
+
password += chars.substring(randomNumber, randomNumber + 1);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// print new passwors
|
|
22
|
+
console.info(colors.yellow("new password:"), password);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export default genPassword;
|