stack-analyze 1.3.5 → 1.3.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.
Files changed (43) hide show
  1. package/CHANGELOG.md +335 -311
  2. package/LICENSE +21 -21
  3. package/about.js +98 -121
  4. package/api/pokerApi.js +5 -5
  5. package/api/wallpapersURL.js +7 -5
  6. package/api/webApis.js +21 -21
  7. package/cli.js +204 -213
  8. package/eslint.config.js +44 -44
  9. package/functions/animeInfo.js +45 -45
  10. package/functions/bitly.js +41 -41
  11. package/functions/bundlephobia.js +36 -36
  12. package/functions/cryptoList.js +48 -48
  13. package/functions/cssValidator.js +25 -25
  14. package/functions/deezer.js +37 -37
  15. package/functions/download.js +25 -24
  16. package/functions/gitUser.js +37 -37
  17. package/functions/hardware.js +109 -109
  18. package/functions/moviesInfo.js +55 -55
  19. package/functions/multipleStack.js +53 -53
  20. package/functions/pageSpeed.js +82 -82
  21. package/functions/password.js +24 -24
  22. package/functions/pokemon.js +106 -106
  23. package/functions/poker.js +40 -42
  24. package/functions/potterSearch.js +32 -32
  25. package/functions/quotes.js +33 -0
  26. package/functions/scraping.js +132 -132
  27. package/functions/singleStack.js +48 -48
  28. package/functions/twitch.js +72 -72
  29. package/hash/infoTools.js +61 -61
  30. package/hash/queryTools.js +113 -116
  31. package/hash/quotesSelect.js +16 -0
  32. package/hash/utilityTools.js +33 -32
  33. package/hash/wallpaperSelect.js +90 -59
  34. package/hash/webTools.js +93 -92
  35. package/logo-module.webp +0 -0
  36. package/menu.js +13 -13
  37. package/package.json +67 -67
  38. package/prompts/webPrompts.js +31 -31
  39. package/readme.md +44 -44
  40. package/types.js +51 -0
  41. package/utils.js +96 -101
  42. package/validations/infoValidations.js +37 -37
  43. package/validations/webValidations.js +33 -33
@@ -1,48 +1,48 @@
1
- // module
2
- import colors from "colors";
3
- import { printTable } from "console-table-printer";
4
-
5
- // utils
6
- import { listFormat, stackSave } from "../utils.js";
7
-
8
- // wappalyzer
9
- import { wappalyzer } from "../api/webApis.js";
10
-
11
- /**
12
- *
13
- * @description call single website tech stack analyze
14
- * @async
15
- * @param { string } url - analyze single website stack
16
- * @returns { Promise<void> } - return async results single web
17
- */
18
- export default async function singleStack(url) {
19
- try {
20
- await wappalyzer.init();
21
-
22
- const { technologies } = await (await wappalyzer.open(url)).analyze();
23
-
24
- const stackResult = technologies.map(({
25
- name,
26
- website,
27
- categories
28
- }) => {
29
- const stackCategories = categories.map(({ name }) => name);
30
-
31
- return {
32
- techName: name,
33
- techWebsite: website,
34
- techCategories: listFormat.format(stackCategories)
35
- };
36
- });
37
-
38
- console.info(url.green);
39
-
40
- printTable(stackResult.slice(0, 10));
41
-
42
- stackSave("single-stack.json", JSON.stringify(stackResult, null, 2));
43
- } catch (err) {
44
- console.error(colors.red(err.message));
45
- }
46
-
47
- await wappalyzer.destroy();
48
- }
1
+ // module
2
+ import colors from "colors";
3
+ import { printTable } from "console-table-printer";
4
+
5
+ // utils
6
+ import { listFormat, stackSave } from "../utils.js";
7
+
8
+ // wappalyzer
9
+ import { wappalyzer } from "../api/webApis.js";
10
+
11
+ /**
12
+ *
13
+ * @description call single website tech stack analyze
14
+ * @async
15
+ * @param { string } url - analyze single website stack
16
+ * @returns { Promise<void> } - return async results single web
17
+ */
18
+ export default async function singleStack(url) {
19
+ try {
20
+ await wappalyzer.init();
21
+
22
+ const { technologies } = await (await wappalyzer.open(url)).analyze();
23
+
24
+ const stackResult = technologies.map(({
25
+ name,
26
+ website,
27
+ categories
28
+ }) => {
29
+ const stackCategories = categories.map(({ name }) => name);
30
+
31
+ return {
32
+ techName: name,
33
+ techWebsite: website,
34
+ techCategories: listFormat.format(stackCategories)
35
+ };
36
+ });
37
+
38
+ console.info(url.green);
39
+
40
+ printTable(stackResult.slice(0, 10));
41
+
42
+ stackSave("single-stack.json", JSON.stringify(stackResult, null, 2));
43
+ } catch (err) {
44
+ console.error(colors.red(err.message));
45
+ }
46
+
47
+ await wappalyzer.destroy();
48
+ }
@@ -1,72 +1,72 @@
1
- // modules
2
- import axios from "axios";
3
- import { format } from "timeago.js";
4
- import { printTable } from "console-table-printer";
5
- import colors from "colors";
6
-
7
- // save twitch users
8
- import { stackSave } from "../utils.js";
9
-
10
- /**
11
- * types for twitch info
12
- *
13
- * @typedef {Object} Twitch
14
- * @property {string} Twitch.twitchUsers
15
- * @property {string} Twitch.twitchSeparator
16
- * @property {string} Twitch.twitchToken
17
- * @property {string} Twitch.twitchClient
18
- */
19
-
20
- /**
21
- * @description twitch user info
22
- * @async
23
- * @param {Twitch} param
24
- * @returns { Promise<void> } - return twitch results
25
- */
26
- export default async function twitchInfo({
27
- twitchUsers,
28
- twitchSeparator,
29
- twitchToken,
30
- twitchClient
31
- }) {
32
-
33
- const userList = twitchUsers.split(twitchSeparator);
34
-
35
- if(userList.length === 10) {
36
- console.error("twitch users must be 10".bgRed);
37
- }
38
-
39
- const params = new URLSearchParams();
40
-
41
- userList.forEach((item) => {
42
- params.append("login", item);
43
- });
44
-
45
- try {
46
- const { data: twitchData } = await axios.get("https://api.twitch.tv/helix/users", {
47
- params,
48
- headers: {
49
- Authorization: `Bearer ${twitchToken}`,
50
- "Client-Id": twitchClient
51
- }
52
- });
53
-
54
- const result = twitchData.data.map(({
55
- display_name,
56
- broadcaster_type,
57
- view_count,
58
- created_at
59
- }) => ({
60
- username: display_name,
61
- broadcaster: broadcaster_type || "user",
62
- viewCount: view_count,
63
- accountDate: new Date(created_at).toLocaleDateString(),
64
- accountAge: format(created_at)
65
- }));
66
-
67
- printTable(result);
68
- stackSave("twitch-users.json", JSON.stringify(result, null, 2));
69
- } catch (err) {
70
- console.error(colors.red(err.message));
71
- }
72
- }
1
+ // modules
2
+ import axios from "axios";
3
+ import { format } from "timeago.js";
4
+ import { printTable } from "console-table-printer";
5
+ import colors from "colors";
6
+
7
+ // save twitch users
8
+ import { stackSave } from "../utils.js";
9
+
10
+ /**
11
+ * types for twitch info
12
+ *
13
+ * @typedef {Object} Twitch
14
+ * @property {string} Twitch.twitchUsers
15
+ * @property {string} Twitch.twitchSeparator
16
+ * @property {string} Twitch.twitchToken
17
+ * @property {string} Twitch.twitchClient
18
+ */
19
+
20
+ /**
21
+ * @description twitch user info
22
+ * @async
23
+ * @param {Twitch} param
24
+ * @returns { Promise<void> } - return twitch results
25
+ */
26
+ export default async function twitchInfo({
27
+ twitchUsers,
28
+ twitchSeparator,
29
+ twitchToken,
30
+ twitchClient
31
+ }) {
32
+
33
+ const userList = twitchUsers.split(twitchSeparator);
34
+
35
+ if(userList.length === 10) {
36
+ console.error("twitch users must be 10".bgRed);
37
+ }
38
+
39
+ const params = new URLSearchParams();
40
+
41
+ userList.forEach((item) => {
42
+ params.append("login", item);
43
+ });
44
+
45
+ try {
46
+ const { data: twitchData } = await axios.get("https://api.twitch.tv/helix/users", {
47
+ params,
48
+ headers: {
49
+ Authorization: `Bearer ${twitchToken}`,
50
+ "Client-Id": twitchClient
51
+ }
52
+ });
53
+
54
+ const result = twitchData.data.map(({
55
+ display_name,
56
+ broadcaster_type,
57
+ view_count,
58
+ created_at
59
+ }) => ({
60
+ username: display_name,
61
+ broadcaster: broadcaster_type || "user",
62
+ viewCount: view_count,
63
+ accountDate: new Date(created_at).toLocaleDateString(),
64
+ accountAge: format(created_at)
65
+ }));
66
+
67
+ printTable(result);
68
+ stackSave("twitch-users.json", JSON.stringify(result, null, 2));
69
+ } catch (err) {
70
+ console.error(colors.red(err.message));
71
+ }
72
+ }
package/hash/infoTools.js CHANGED
@@ -1,61 +1,61 @@
1
- // inquirer
2
- import { input, password } from "@inquirer/prompts";
3
-
4
- // functions
5
- import bitlyInfo from "../functions/bitly.js";
6
- import cryptoMarket from "../functions/cryptoList.js";
7
- import githubInfo from "../functions/gitUser.js";
8
- import bundlephobia from "../functions/bundlephobia.js";
9
-
10
- // bitly regexp
11
- const bitlyRegexp = /bit\.ly\//g;
12
-
13
- const infoTools = {
14
- async github_info(refreshCallback) {
15
- console.clear();
16
-
17
- const gitUser = await input({
18
- message: "enter a github user for search",
19
- required: true
20
- });
21
-
22
- githubInfo(gitUser);
23
- setTimeout(refreshCallback, 2e3);
24
- },
25
- async bitly_info(refreshCallback) {
26
- console.clear();
27
-
28
- const { bitlyLink, token } = {
29
- bitlyLink: await input({
30
- message: "enter a short link:",
31
- validate: input => bitlyRegexp.test(input) || "only bitly link".yellow
32
- }),
33
- token: await password({
34
- message: "enter a bitly token",
35
- required: true,
36
- mask: true
37
- })
38
- };
39
-
40
- bitlyInfo(bitlyLink, token);
41
- setTimeout(refreshCallback, 2e3);
42
- },
43
- crypto_market(refreshCallback) {
44
- console.clear();
45
- cryptoMarket();
46
- setTimeout(refreshCallback, 5e3);
47
- },
48
- async bundlephobia_info(refreshCallback) {
49
- console.clear();
50
-
51
- const pkgName = await input({
52
- message: "enter a npm package name for search info size"
53
- });
54
-
55
- console.info(pkgName);
56
- bundlephobia(pkgName);
57
- setTimeout(refreshCallback, 5e3);
58
- },
59
- };
60
-
61
- export default infoTools;
1
+ // inquirer
2
+ import { input, password } from "@inquirer/prompts";
3
+
4
+ // functions
5
+ import bitlyInfo from "../functions/bitly.js";
6
+ import cryptoMarket from "../functions/cryptoList.js";
7
+ import githubInfo from "../functions/gitUser.js";
8
+ import bundlephobia from "../functions/bundlephobia.js";
9
+
10
+ // bitly regexp
11
+ const bitlyRegexp = /bit\.ly\//g;
12
+
13
+ /** @type {import("../types.js").Select}*/
14
+ const infoTools = {
15
+ async github_info(refreshCallback) {
16
+ console.clear();
17
+
18
+ const gitUser = await input({
19
+ message: "enter a github user for search",
20
+ required: true
21
+ });
22
+
23
+ githubInfo(gitUser);
24
+ setTimeout(refreshCallback, 2e3);
25
+ },
26
+ async bitly_info(refreshCallback) {
27
+ console.clear();
28
+
29
+ const { bitlyLink, token } = {
30
+ bitlyLink: await input({
31
+ message: "enter a short link:",
32
+ validate: input => bitlyRegexp.test(input) || "only bitly link".yellow
33
+ }),
34
+ token: await password({
35
+ message: "enter a bitly token",
36
+ mask: true
37
+ })
38
+ };
39
+
40
+ bitlyInfo(bitlyLink, token);
41
+ setTimeout(refreshCallback, 2e3);
42
+ },
43
+ crypto_market(refreshCallback) {
44
+ console.clear();
45
+ cryptoMarket();
46
+ setTimeout(refreshCallback, 5e3);
47
+ },
48
+ async bundlephobia_info(refreshCallback) {
49
+ console.clear();
50
+
51
+ const pkgName = await input({
52
+ message: "enter a npm package name for search info size"
53
+ });
54
+
55
+ console.info(pkgName);
56
+ bundlephobia(pkgName);
57
+ setTimeout(refreshCallback, 5e3);
58
+ },
59
+ };
60
+
61
+ export default infoTools;
@@ -1,116 +1,113 @@
1
- // inquirer
2
- import { input, password, select, number } from "@inquirer/prompts";
3
-
4
- // functions
5
- import animeSearch from "../functions/animeInfo.js";
6
- import movieDB from "../functions/moviesInfo.js";
7
- import pokemonInfo from "../functions/pokemon.js";
8
- import twitchInfo from "../functions/twitch.js";
9
- import deezer from "../functions/deezer.js";
10
- import potterSearch from "../functions/potterSearch.js";
11
-
12
- /** query tools */
13
- const queryTools = {
14
- async anime_Search(refreshCallback) {
15
- console.clear();
16
-
17
- const query = await input({
18
- message: "enter a anime keyword for search",
19
- required: true
20
- });
21
-
22
- animeSearch(query);
23
- setTimeout(refreshCallback, 2e3);
24
- },
25
- async movie_info(refreshCallback) {
26
- console.clear();
27
-
28
- const { query, token } = {
29
- query: await input({
30
- message: "enter movie for search DB",
31
- required: true
32
- }),
33
- token: await password({
34
- message: "enter a token key",
35
- required: true,
36
- mask: true
37
- })
38
- };
39
-
40
- movieDB(query, token);
41
- setTimeout(refreshCallback, 2e3);
42
- },
43
- async pokemon_info(refreshCallback) {
44
- console.clear();
45
-
46
- const pokeSelect = await select({
47
- message: "enter a opt for start search",
48
- choices: ["id", "name"],
49
- });
50
-
51
- const opt = pokeSelect === "id"
52
- ? await number({
53
- message: "enter a poekmon ID:",
54
- min: 1,
55
- required: true
56
- }) : await input({
57
- message: "enter a poekmon name:",
58
- required: true,
59
- validate: input => /[^0-9]/.test(input) || "the pokemon name is required"
60
- });
61
-
62
- pokemonInfo(opt);
63
- setTimeout(refreshCallback, 6e3);
64
- },
65
- async twitch_info(refreshCallback) {
66
- console.clear();
67
-
68
- const { twitchSeparator, twitchUsers, twitchClient, twitchToken } = {
69
- twitchSeparator: await input({
70
- message: "enter a separator for split example ',':",
71
- required: true
72
- }),
73
- twitchUsers: await input({
74
- message: "enter a twitch users example 'a,b,c'",
75
- required: true
76
- }),
77
- twitchClient: await password({
78
- message: "enter a twitch client ID:",
79
- required: true,
80
- mask: true
81
- }),
82
- twitchToken: await password({
83
- message: "enter a twitch token:",
84
- required: true,
85
- mask: true
86
- })
87
- };
88
-
89
- twitchInfo({ twitchSeparator, twitchUsers, twitchClient, twitchToken });
90
- setTimeout(refreshCallback, 2e3);
91
- },
92
- async deezer(refreshCallback) {
93
- console.clear();
94
-
95
- const query = await input({
96
- message: "enter a query for search",
97
- required: true
98
- });
99
-
100
- setTimeout(refreshCallback, 5e3);
101
- deezer(query);
102
- },
103
- async potter_search(refreshCallback) {
104
- console.clear();
105
-
106
- const search = await input({
107
- message: "enter a keyword or name for search",
108
- required: true
109
- });
110
-
111
- potterSearch(search);
112
- setTimeout(refreshCallback, 5e3);
113
- }
114
- };
115
-
116
- export default queryTools;
1
+ // inquirer
2
+ import { input, password, select, number } from "@inquirer/prompts";
3
+
4
+ // functions
5
+ import animeSearch from "../functions/animeInfo.js";
6
+ import movieDB from "../functions/moviesInfo.js";
7
+ import pokemonInfo from "../functions/pokemon.js";
8
+ import twitchInfo from "../functions/twitch.js";
9
+ import deezer from "../functions/deezer.js";
10
+ import potterSearch from "../functions/potterSearch.js";
11
+
12
+ /** @type {import("../types.js").Select}*/
13
+ const queryTools = {
14
+ async anime_Search(refreshCallback) {
15
+ console.clear();
16
+
17
+ const query = await input({
18
+ message: "enter a anime keyword for search",
19
+ required: true
20
+ });
21
+
22
+ animeSearch(query);
23
+ setTimeout(refreshCallback, 2e3);
24
+ },
25
+ async movie_info(refreshCallback) {
26
+ console.clear();
27
+
28
+ const { query, token } = {
29
+ query: await input({
30
+ message: "enter movie for search DB",
31
+ required: true
32
+ }),
33
+ token: await password({
34
+ message: "enter a token key",
35
+ mask: true
36
+ })
37
+ };
38
+
39
+ movieDB(query, token);
40
+ setTimeout(refreshCallback, 2e3);
41
+ },
42
+ async pokemon_info(refreshCallback) {
43
+ console.clear();
44
+
45
+ const pokeSelect = await select({
46
+ message: "enter a opt for start search",
47
+ choices: ["id", "name"],
48
+ });
49
+
50
+ const opt = pokeSelect === "id"
51
+ ? await number({
52
+ message: "enter a poekmon ID:",
53
+ min: 1,
54
+ required: true
55
+ }) : await input({
56
+ message: "enter a poekmon name:",
57
+ required: true,
58
+ validate: input => /[^0-9]/.test(input) || "the pokemon name is required"
59
+ });
60
+
61
+ pokemonInfo(opt);
62
+ setTimeout(refreshCallback, 6e3);
63
+ },
64
+ async twitch_info(refreshCallback) {
65
+ console.clear();
66
+
67
+ const { twitchSeparator, twitchUsers, twitchClient, twitchToken } = {
68
+ twitchSeparator: await input({
69
+ message: "enter a separator for split example ',':",
70
+ required: true
71
+ }),
72
+ twitchUsers: await input({
73
+ message: "enter a twitch users example 'a,b,c'",
74
+ required: true
75
+ }),
76
+ twitchClient: await password({
77
+ message: "enter a twitch client ID:",
78
+ mask: true
79
+ }),
80
+ twitchToken: await password({
81
+ message: "enter a twitch token:",
82
+ mask: true
83
+ })
84
+ };
85
+
86
+ twitchInfo({ twitchSeparator, twitchUsers, twitchClient, twitchToken });
87
+ setTimeout(refreshCallback, 2e3);
88
+ },
89
+ async deezer(refreshCallback) {
90
+ console.clear();
91
+
92
+ const query = await input({
93
+ message: "enter a query for search",
94
+ required: true
95
+ });
96
+
97
+ setTimeout(refreshCallback, 5e3);
98
+ deezer(query);
99
+ },
100
+ async potter_search(refreshCallback) {
101
+ console.clear();
102
+
103
+ const search = await input({
104
+ message: "enter a keyword or name for search",
105
+ required: true
106
+ });
107
+
108
+ potterSearch(search);
109
+ setTimeout(refreshCallback, 5e3);
110
+ }
111
+ };
112
+
113
+ export default queryTools;
@@ -0,0 +1,16 @@
1
+ import { input } from "@inquirer/prompts";
2
+ import { getAnimeQuote } from "../functions/quotes.js";
3
+
4
+ /** @type {import("../types.js").Select}*/
5
+ const quoteSelect = {
6
+ animeQuote: async (refreshCallback) => {
7
+ const quote = await input({
8
+ message: "enter a anime for get random quote: \u0022if press enter key get random\u0022:".yellow,
9
+ });
10
+
11
+ getAnimeQuote(quote);
12
+ setTimeout(refreshCallback, 5000);
13
+ },
14
+ };
15
+
16
+ export default quoteSelect;