stack-analyze 1.3.4 → 1.3.6
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 +326 -296
- package/LICENSE +21 -21
- package/{about.cjs → about.js} +121 -121
- package/api/pokerApi.js +5 -0
- package/api/wallpapersURL.js +7 -6
- package/api/webApis.js +21 -21
- package/cli.js +213 -227
- package/eslint.config.js +44 -44
- package/functions/animeInfo.js +45 -45
- package/functions/bitly.js +41 -41
- package/functions/bundlephobia.js +36 -36
- package/functions/cryptoList.js +48 -48
- package/functions/cssValidator.js +25 -25
- package/functions/deezer.js +37 -37
- package/functions/download.js +25 -24
- package/functions/gitUser.js +37 -37
- package/functions/hardware.js +109 -109
- package/functions/moviesInfo.js +55 -55
- package/functions/multipleStack.js +53 -53
- package/functions/pageSpeed.js +82 -82
- package/functions/password.js +24 -24
- package/functions/pokemon.js +106 -106
- package/functions/poker.js +40 -0
- package/functions/potterSearch.js +32 -32
- package/functions/scraping.js +132 -132
- package/functions/singleStack.js +48 -48
- package/functions/twitch.js +72 -72
- package/hash/infoTools.js +61 -57
- package/hash/queryTools.js +116 -119
- package/hash/utilityTools.js +32 -19
- package/hash/wallpaperSelect.js +89 -76
- package/hash/webTools.js +92 -68
- package/logo-module.webp +0 -0
- package/menu.js +13 -0
- package/package.json +67 -66
- package/prompts/webPrompts.js +31 -0
- package/readme.md +44 -44
- package/utils.js +104 -94
- package/validations/infoValidations.js +37 -37
- package/validations/webValidations.js +33 -33
package/utils.js
CHANGED
|
@@ -1,94 +1,104 @@
|
|
|
1
|
-
import { writeFile } from "node:fs/promises";
|
|
2
|
-
|
|
3
|
-
const listFormat = new Intl.ListFormat("en", {
|
|
4
|
-
style: "short",
|
|
5
|
-
type: "conjunction"
|
|
6
|
-
});
|
|
7
|
-
|
|
8
|
-
const currency = new Intl.NumberFormat("en-us", {
|
|
9
|
-
style: "currency", currency: "USD"
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
const returnMainOpts = "return main menu";
|
|
13
|
-
|
|
14
|
-
const menuOpts = [
|
|
15
|
-
"web", "info", "query", "utility", "wallpapers",
|
|
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
|
-
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
1
|
+
import { writeFile } from "node:fs/promises";
|
|
2
|
+
|
|
3
|
+
const listFormat = new Intl.ListFormat("en", {
|
|
4
|
+
style: "short",
|
|
5
|
+
type: "conjunction"
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
const currency = new Intl.NumberFormat("en-us", {
|
|
9
|
+
style: "currency", currency: "USD"
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
const returnMainOpts = "return main menu";
|
|
13
|
+
|
|
14
|
+
const menuOpts = [
|
|
15
|
+
"web", "info", "query", "utility", "wallpapers",
|
|
16
|
+
"about", "exit"
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
const menuWebOpts = [
|
|
20
|
+
"single", "multiple", "pagespeed", "scraping", "css_validate",
|
|
21
|
+
returnMainOpts
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
const menuInfoOpts = [
|
|
25
|
+
"github_info", "crypto_market", "bitly_info", "bundlephobia_info", returnMainOpts
|
|
26
|
+
];
|
|
27
|
+
|
|
28
|
+
const menuQueryOpts = [
|
|
29
|
+
"anime_Search", "movie_info", "pokemon_info",
|
|
30
|
+
"twitch_info", "deezer", "potter_search", returnMainOpts
|
|
31
|
+
];
|
|
32
|
+
|
|
33
|
+
const menuUtilityOpts = [
|
|
34
|
+
"hardware", "password", "poker_game", returnMainOpts
|
|
35
|
+
];
|
|
36
|
+
|
|
37
|
+
const menuWallpaperOpts = [
|
|
38
|
+
"solMoon", "dimensions", "seyyahi2", "ancientMistery",
|
|
39
|
+
"tsukyNoEmily", returnMainOpts
|
|
40
|
+
];
|
|
41
|
+
|
|
42
|
+
const menuHardwareOpts = [
|
|
43
|
+
"cpuInfo", "ramMemInfo", "osDetail", "diskInfo",
|
|
44
|
+
"controllerInfo", "displayInfo", "biosInfo", returnMainOpts
|
|
45
|
+
];
|
|
46
|
+
|
|
47
|
+
const menuAboutOpts = [
|
|
48
|
+
"mainInfo", "lineup", "youtubeRecomendation",
|
|
49
|
+
"twitchRecomendation", "projectsRecomendation", returnMainOpts
|
|
50
|
+
];
|
|
51
|
+
|
|
52
|
+
const scrapingOpts = [
|
|
53
|
+
"title", "images", "metadata", "headings",
|
|
54
|
+
"tableHead", "tableData", "links", "cites"
|
|
55
|
+
];
|
|
56
|
+
|
|
57
|
+
const pokerGameOpts = [
|
|
58
|
+
"go-fish", "gin-rummy", "blackjack", "slapjack",
|
|
59
|
+
"basics-of-poker", "texas-holdem-poker"
|
|
60
|
+
];
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
*
|
|
64
|
+
* @param {string} filename
|
|
65
|
+
* @param {any} data
|
|
66
|
+
* @returns {Promise<void>}
|
|
67
|
+
*/
|
|
68
|
+
const stackSave = async (filename, data) => {
|
|
69
|
+
if (!data) {
|
|
70
|
+
console.error("stackSave no using falsy values");
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if(typeof data === "boolean") {
|
|
75
|
+
console.info("stackSave no using boolean types");
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
try {
|
|
80
|
+
await writeFile(filename, data);
|
|
81
|
+
} catch (err) {
|
|
82
|
+
console.info(err.message);
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
const exitCli = "thanks for use stack-analyze";
|
|
87
|
+
|
|
88
|
+
export {
|
|
89
|
+
listFormat,
|
|
90
|
+
currency,
|
|
91
|
+
menuOpts,
|
|
92
|
+
menuWebOpts,
|
|
93
|
+
menuInfoOpts,
|
|
94
|
+
menuQueryOpts,
|
|
95
|
+
menuUtilityOpts,
|
|
96
|
+
menuHardwareOpts,
|
|
97
|
+
menuWallpaperOpts,
|
|
98
|
+
menuAboutOpts,
|
|
99
|
+
scrapingOpts,
|
|
100
|
+
stackSave,
|
|
101
|
+
pokerGameOpts,
|
|
102
|
+
exitCli
|
|
103
|
+
};
|
|
104
|
+
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
// bitly regexp
|
|
2
|
-
const bitlyRegexp = /bit\.ly\//g;
|
|
3
|
-
|
|
4
|
-
const bitlyQuery = {
|
|
5
|
-
name: "bitlyLink",
|
|
6
|
-
message: "enter a short link:",
|
|
7
|
-
validate: input => bitlyRegexp.test(input) || "only bitly link".yellow
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* @param {string} name
|
|
12
|
-
* @param {string} message
|
|
13
|
-
*/
|
|
14
|
-
const promptParams = (name, message) => ({
|
|
15
|
-
name,
|
|
16
|
-
message,
|
|
17
|
-
validate: input => input !== "" || "this field is required".yellow
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* @param {string} name
|
|
22
|
-
* @param {string} message
|
|
23
|
-
*/
|
|
24
|
-
const promptKey = (name, message) => ({
|
|
25
|
-
name,
|
|
26
|
-
message,
|
|
27
|
-
type: "password",
|
|
28
|
-
mask: "?",
|
|
29
|
-
validate: input => input !== "" || "token field is required".yellow
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
export {
|
|
33
|
-
bitlyQuery,
|
|
34
|
-
promptParams,
|
|
35
|
-
promptKey
|
|
36
|
-
};
|
|
37
|
-
|
|
1
|
+
// bitly regexp
|
|
2
|
+
const bitlyRegexp = /bit\.ly\//g;
|
|
3
|
+
|
|
4
|
+
const bitlyQuery = {
|
|
5
|
+
name: "bitlyLink",
|
|
6
|
+
message: "enter a short link:",
|
|
7
|
+
validate: input => bitlyRegexp.test(input) || "only bitly link".yellow
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @param {string} name
|
|
12
|
+
* @param {string} message
|
|
13
|
+
*/
|
|
14
|
+
const promptParams = (name, message) => ({
|
|
15
|
+
name,
|
|
16
|
+
message,
|
|
17
|
+
validate: input => input !== "" || "this field is required".yellow
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* @param {string} name
|
|
22
|
+
* @param {string} message
|
|
23
|
+
*/
|
|
24
|
+
const promptKey = (name, message) => ({
|
|
25
|
+
name,
|
|
26
|
+
message,
|
|
27
|
+
type: "password",
|
|
28
|
+
mask: "?",
|
|
29
|
+
validate: input => input !== "" || "token field is required".yellow
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
export {
|
|
33
|
+
bitlyQuery,
|
|
34
|
+
promptParams,
|
|
35
|
+
promptKey
|
|
36
|
+
};
|
|
37
|
+
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { scrapingOpts } from "../utils.js";
|
|
2
|
-
|
|
3
|
-
const webRegex = /https?:\/\//g;
|
|
4
|
-
|
|
5
|
-
const singleWebQuery = {
|
|
6
|
-
name: "url",
|
|
7
|
-
message: "enter a url:",
|
|
8
|
-
validate: input => webRegex.test(input) || "enter a url valid".yellow
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
const multipleWebQuery = {
|
|
12
|
-
name: "webList",
|
|
13
|
-
message: "enter URLs for analyze the tech stacks with whitespace without quotes example 'http://example.com https://nodejs.org': \n",
|
|
14
|
-
validate(input) {
|
|
15
|
-
const pass = input.match(webRegex);
|
|
16
|
-
|
|
17
|
-
return pass && pass.length === 2 || "must be 2 sites";
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
const webScrapingQuery = {
|
|
22
|
-
type: "list",
|
|
23
|
-
pageSize: 9,
|
|
24
|
-
name: "option",
|
|
25
|
-
message: "select a web scraping option:",
|
|
26
|
-
choices: scrapingOpts
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export {
|
|
30
|
-
singleWebQuery,
|
|
31
|
-
multipleWebQuery,
|
|
32
|
-
webScrapingQuery
|
|
33
|
-
};
|
|
1
|
+
import { scrapingOpts } from "../utils.js";
|
|
2
|
+
|
|
3
|
+
const webRegex = /https?:\/\//g;
|
|
4
|
+
|
|
5
|
+
const singleWebQuery = {
|
|
6
|
+
name: "url",
|
|
7
|
+
message: "enter a url:",
|
|
8
|
+
validate: input => webRegex.test(input) || "enter a url valid".yellow
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const multipleWebQuery = {
|
|
12
|
+
name: "webList",
|
|
13
|
+
message: "enter URLs for analyze the tech stacks with whitespace without quotes example 'http://example.com https://nodejs.org': \n",
|
|
14
|
+
validate(input) {
|
|
15
|
+
const pass = input.match(webRegex);
|
|
16
|
+
|
|
17
|
+
return pass && pass.length === 2 || "must be 2 sites";
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const webScrapingQuery = {
|
|
22
|
+
type: "list",
|
|
23
|
+
pageSize: 9,
|
|
24
|
+
name: "option",
|
|
25
|
+
message: "select a web scraping option:",
|
|
26
|
+
choices: scrapingOpts
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export {
|
|
30
|
+
singleWebQuery,
|
|
31
|
+
multipleWebQuery,
|
|
32
|
+
webScrapingQuery
|
|
33
|
+
};
|